Changeset 3971 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Apr 26, 2005, 1:23:57 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/math
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/math/vector.cc
r3970 r3971 441 441 \returns the Result of the smooth move 442 442 */ 443 Quaternion Quaternion::quatSlerp(const Quaternion& from, const Quaternion& to, float t)443 Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t) 444 444 { 445 445 float tol[4]; 446 446 double omega, cosom, sinom, scale0, scale1; 447 DELTA = 0.2;447 // float DELTA = 0.2; 448 448 449 449 cosom = from.v.x * to.v.x + from.v.y * to.v.y + from.v.z * to.v.z + from.w * to.w; … … 488 488 res.w = scale0 * from.w + scale1 * tol[3]; 489 489 */ 490 return Quaternion(scale0 * from.w + scale1 * tol[3], 491 Vector(scale0 * from.v.x + scale1 * tol[0], 490 return Quaternion(Vector(scale0 * from.v.x + scale1 * tol[0], 492 491 scale0 * from.v.y + scale1 * tol[1], 493 scale0 * from.v.z + scale1 * tol[2])); 492 scale0 * from.v.z + scale1 * tol[2]), 493 scale0 * from.w + scale1 * tol[3]); 494 494 } 495 495 -
orxonox/trunk/src/lib/math/vector.h
r3966 r3971 76 76 77 77 inline Quaternion () { w = 1; v = Vector(0,0,0); } 78 inline Quaternion (const Vector& b, float a) { w = a; v = b; }78 inline Quaternion (const Vector& v, float f) { this->w = f; this->v = v; } 79 79 Quaternion (float m[4][4]); 80 80 inline Quaternion (float angle, const Vector& axis) { w = cos(angle/2); v = axis * sin(angle/2); } … … 99 99 float norm () const; 100 100 void matrix (float m[4][4]) const; 101 Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);102 101 103 102 void debug(); 104 private: 105 float DELTA; //!< resolution of calculation 103 }; 106 104 107 }; 105 Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t); 106 107 108 108 109 109 //! 3D rotation (OBSOLETE)
Note: See TracChangeset
for help on using the changeset viewer.