Changeset 4992 in orxonox.OLD for orxonox/trunk/src/lib/math
- Timestamp:
- Aug 13, 2005, 10:02:40 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/math/vector.h
r4966 r4992 29 29 /** @param index The index of the "array" @returns the x/y/z coordinate */ 30 30 inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; } 31 /** *@param v The vector to add @returns the addition between two vectors (this + v) */31 /** @param v The vector to add @returns the addition between two vectors (this + v) */ 32 32 inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); }; 33 /** *@param v The vector to add @returns the addition between two vectors (this + v) */33 /** @param v The vector to add @returns the addition between two vectors (this + v) */ 34 34 inline Vector operator+ (const sVec3D& v) const { return Vector(x + v[0], y + v[1], z + v[2]); }; 35 35 /** @param v The vector to add @returns the addition between two vectors (this += v) */ … … 57 57 /** @param f a factor to divide the vector with @returns the vector divided by f (this /= f) */ 58 58 inline const Vector& operator/= (float f) {if (unlikely(f == 0.0)) {this->x=0;this->y=0;this->z=0;} else {this->x /= f; this->y /= f; this->z /= f;} return *this; }; 59 /** \briefcopy constructor @todo (i do not know it this is faster) @param v the vector to assign to this vector. @returns the vector v */59 /** copy constructor @todo (i do not know it this is faster) @param v the vector to assign to this vector. @returns the vector v */ 60 60 inline const Vector& operator= (const Vector& v) { this->x = v.x; this->y = v.y; this->z = v.z; return *this; }; 61 /** \briefcopy constructor* @param v the sVec3D to assign to this vector. @returns the vector v */61 /** copy constructor* @param v the sVec3D to assign to this vector. @returns the vector v */ 62 62 inline const Vector& operator= (const sVec3D& v) { this->x = v[0]; this->y = v[1]; this->z = v[2]; } 63 63 /** @param v: the other vector \return the dot product of the vectors */ … … 65 65 /** @param v: the corss-product partner @returns the cross-product between this and v (this (x) v) */ 66 66 inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); } 67 /** \briefscales the this vector with v* @param v the vector to scale this with */67 /** scales the this vector with v* @param v the vector to scale this with */ 68 68 void scale(const Vector& v) { x *= v.x; y *= v.y; z *= v.z; }; 69 69 /** @returns the length of the vector */ 70 70 inline float len() const { return sqrt (x*x+y*y+z*z); } 71 /** \briefnormalizes the vector */71 /** normalizes the vector */ 72 72 inline void normalize() { 73 73 float l = len();
Note: See TracChangeset
for help on using the changeset viewer.