Changeset 10698 in orxonox.OLD for trunk/src/lib/math
- Timestamp:
- Jun 14, 2007, 5:33:43 PM (18 years ago)
- Location:
- trunk/src/lib/math
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/math/quaternion.h
r10695 r10698 50 50 51 51 /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */ 52 inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };52 inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; }; 53 53 /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */ 54 inline bool operator!= (const Quaternion& q) const { return (unlikely(this->v!=q.v||this->w!=q.w))?true:false; };54 inline bool operator!= (const Quaternion& q) const { return (unlikely(this->v!=q.v||this->w!=q.w))?true:false; }; 55 55 /** @param f: a real value @return a Quaternion containing the quotient */ 56 56 inline Quaternion operator/ (const float& f) const { return (unlikely(f==0.0)) ? Quaternion() : Quaternion(this->v/f, this->w/f); }; … … 118 118 119 119 120 inlinevoid slerpTo(const Quaternion& toQuat, float t);120 void slerpTo(const Quaternion& toQuat, float t); 121 121 static Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t); 122 122 -
trunk/src/lib/math/vector.h
r10376 r10698 51 51 52 52 /** @param index The index of the "array" @returns the x/y/z coordinate */ 53 inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; }53 inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; else return this->x; } 54 54 /** @param v The vector to add @returns the addition between two vectors (this + v) */ 55 55 inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); }; … … 64 64 /** @param v The vector to substract @returns the substraction between two vectors (this - v) */ 65 65 inline Vector operator- (const sVec3D& v) const { return Vector(x - v[0], y - v[1], z - v[2]); } 66 /** @returns the substraction between (0, 0, 0) and this (null-this) */ 67 inline Vector operator- () const { return Vector(-x, -y, -z); } 66 68 /** @param v The vector to substract @returns the substraction between two vectors (this -= v) */ 67 69 inline const Vector& operator-= (const Vector& v) { this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this; };
Note: See TracChangeset
for help on using the changeset viewer.