Changeset 5000 in orxonox.OLD for orxonox/trunk/src/lib/math
- Timestamp:
- Aug 13, 2005, 9:07:56 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/math
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/math/vector.cc
r4999 r5000 282 282 } 283 283 284 void Quaternion::debug2() 285 { 286 Vector axis = this->getSpacialAxis(); 287 PRINT(0)("angle = %f, axis: ax=%f, ay=%f, az=%f\n", this->getSpacialAxisAngle(), axis.x, axis.y, axis.z ); 288 } 289 284 290 /** 285 291 * create a rotation from a vector -
orxonox/trunk/src/lib/math/vector.h
r4999 r5000 157 157 inline Quaternion conjugate () const { return Quaternion(Vector(-v.x, -v.y, -v.z), this->w); }; 158 158 /** @returns the norm of The Quaternion */ 159 inline float norm () const { return w*w + v.x*v.x + v.y*v.y + v.z*v.z; };159 inline float norm () const { return sqrt(w*w + v.x*v.x + v.y*v.y + v.z*v.z); }; 160 160 /** @returns the inverted Quaterntion of this */ 161 inline Quaternion inverse () const { return conjugate() / norm(); };161 inline Quaternion inverse () const { return conjugate() / (w*w + v.x*v.x + v.y*v.y + v.z*v.z); }; 162 162 /** @param v: the Vector @return a new Vector representing v rotated by the Quaternion */ 163 163 inline Vector apply (const Vector& v) const { return (*this * Quaternion(v, 0) * conjugate()).v; }; … … 176 176 177 177 void debug(); 178 void debug2(); 178 179 179 180
Note: See TracChangeset
for help on using the changeset viewer.