Changeset 5419 in orxonox.OLD for trunk/src/lib/math
- Timestamp:
- Oct 22, 2005, 10:55:51 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/math/vector.h
r5215 r5419 157 157 /** @returns the inverted Quaterntion of this */ 158 158 inline Quaternion inverse () const { return conjugate() / (w*w + v.x*v.x + v.y*v.y + v.z*v.z); }; 159 /** @returns the dot Product of a Quaternion */ 160 inline float dot (const Quaternion& q) const { return v.x*q.v.x + v.y*q.v.y + v.z*q.v.z + w*q.w; }; 161 /** @retuns the Distance between two Quaternions */ 162 inline float distance(const Quaternion& q) const { return 2*acos(fabsf(this->dot(q))); }; 159 163 /** @param v: the Vector @return a new Vector representing v rotated by the Quaternion */ 160 164 inline Vector apply (const Vector& v) const { return (*this * Quaternion(v, 0) * conjugate()).v; };
Note: See TracChangeset
for help on using the changeset viewer.