diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-11-02 15:36:19 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-11-02 15:36:19 +0000 |
commit | c823b2bf3165990a556d50990adf4da5cee95593 (patch) | |
tree | 733f3d3a6ed7a5e8f80d4b4553299902d89b58b8 /packages/noncvs/windows/extra/Gem/dev/Utils/Vector.h | |
parent | 2c0b722536a4ec2f723c289b695b983741c678f8 (diff) |
commit Gem 0.93.3 from http://gem.iem.at/releases/0.93.3/Gem-0.93.3-W32-i686.zip
svn path=/trunk/; revision=16521
Diffstat (limited to 'packages/noncvs/windows/extra/Gem/dev/Utils/Vector.h')
-rw-r--r-- | packages/noncvs/windows/extra/Gem/dev/Utils/Vector.h | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/packages/noncvs/windows/extra/Gem/dev/Utils/Vector.h b/packages/noncvs/windows/extra/Gem/dev/Utils/Vector.h index b0b657c5..6923c77f 100644 --- a/packages/noncvs/windows/extra/Gem/dev/Utils/Vector.h +++ b/packages/noncvs/windows/extra/Gem/dev/Utils/Vector.h @@ -1,77 +1,77 @@ -/*----------------------------------------------------------------- -LOG - GEM - Graphics Environment for Multimedia - - vector-classes - - zmoelnig@iem.at, tigital@mac.com - - For information on usage and redistribution, and for a DISCLAIMER OF ALL - WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. - ------------------------------------------------------------------*/ - -#ifndef _INCLUDE__GEM_UTILS_VECTOR_H_ -#define _INCLUDE__GEM_UTILS_VECTOR_H_ - -#include "Gem/ExportDef.h" - - - -// This is our 2D point class. This will be used to store the UV coordinates. -class GEM_EXTERN CVector2 { -public: - float x, y; -}; - - -// This is our basic 3D point/vector class -class GEM_EXTERN CVector3 { -public: - // the elements of a vector: - float x, y, z; - - // A default constructor - CVector3(void); - - // This is our constructor that allows us to initialize our data upon creating an instance - CVector3(float X, float Y, float Z); - - // Here we overload the + operator so we can add vectors together - CVector3 operator+(CVector3 vVector) const; - - // Here we overload the - operator so we can subtract vectors - CVector3 operator-(CVector3 vVector) const; - - // Here we overload the - operator so we can negate the vector - CVector3 operator-(void) const; - - // Here we overload the * operator so we can multiply by scalars - CVector3 operator*(float num) const; - - // Here we overload the * operator so we can dot-multiply - float operator*(CVector3 vVector) const; - - // cross-multiplication - CVector3 cross(CVector3 vVector) const; - - // Here we overload the / operator so we can divide by a scalar - CVector3 operator/(float num) const; - - - // here we calculate the absolute-value of the vector - float abs(void) const; - - // here we calculate the square of the absolute-value of the vector - float abs2(void) const; - - // here we normalize the vector - CVector3 normalize(void) const; - - // here we compare 2 vectors on approx. equality - bool equals(CVector3 vVector, float epsilon) const; - - -}; - -#endif /* _INCLUDE__GEM_UTILS_VECTOR_H_ */ +/*-----------------------------------------------------------------
+LOG
+ GEM - Graphics Environment for Multimedia
+
+ vector-classes
+
+ zmoelnig@iem.at, tigital@mac.com
+
+ For information on usage and redistribution, and for a DISCLAIMER OF ALL
+ WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
+
+-----------------------------------------------------------------*/
+
+#ifndef _INCLUDE__GEM_UTILS_VECTOR_H_
+#define _INCLUDE__GEM_UTILS_VECTOR_H_
+
+#include "Gem/ExportDef.h"
+
+
+
+// This is our 2D point class. This will be used to store the UV coordinates.
+class GEM_EXTERN CVector2 {
+public:
+ float x, y;
+};
+
+
+// This is our basic 3D point/vector class
+class GEM_EXTERN CVector3 {
+public:
+ // the elements of a vector:
+ float x, y, z;
+
+ // A default constructor
+ CVector3(void);
+
+ // This is our constructor that allows us to initialize our data upon creating an instance
+ CVector3(float X, float Y, float Z);
+
+ // Here we overload the + operator so we can add vectors together
+ CVector3 operator+(CVector3 vVector) const;
+
+ // Here we overload the - operator so we can subtract vectors
+ CVector3 operator-(CVector3 vVector) const;
+
+ // Here we overload the - operator so we can negate the vector
+ CVector3 operator-(void) const;
+
+ // Here we overload the * operator so we can multiply by scalars
+ CVector3 operator*(float num) const;
+
+ // Here we overload the * operator so we can dot-multiply
+ float operator*(CVector3 vVector) const;
+
+ // cross-multiplication
+ CVector3 cross(CVector3 vVector) const;
+
+ // Here we overload the / operator so we can divide by a scalar
+ CVector3 operator/(float num) const;
+
+
+ // here we calculate the absolute-value of the vector
+ float abs(void) const;
+
+ // here we calculate the square of the absolute-value of the vector
+ float abs2(void) const;
+
+ // here we normalize the vector
+ CVector3 normalize(void) const;
+
+ // here we compare 2 vectors on approx. equality
+ bool equals(CVector3 vVector, float epsilon) const;
+
+
+};
+
+#endif /* _INCLUDE__GEM_UTILS_VECTOR_H_ */
|