Changeset 3541 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Mar 14, 2005, 12:39:30 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/math
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/math/vector.cc
r3473 r3541 21 21 22 22 #include "vector.h" 23 23 #include "debug.h" 24 24 25 25 using namespace std; … … 201 201 } 202 202 203 204 203 /** 205 204 \brief calculate the angle between two vectors in radiances … … 225 224 f = acos( v1 * v2 / (v1.len() * v2.len())); 226 225 return f * 180 / PI; 226 } 227 228 229 /** 230 \brief Outputs the values of the Vector 231 */ 232 void Vector::debug(void) 233 { 234 PRINT(0)("Vector Debug information\n"); 235 PRINT(0)("x: %f; y: %f; z: %f", x, y, z); 236 PRINT(3)(" lenght: %f", len()); 237 PRINT(0)("\n"); 227 238 } 228 239 … … 581 592 582 593 /** 594 \brief outputs some nice formated debug information about this quaternion 595 */ 596 void Quaternion::debug(void) 597 { 598 PRINT(0)("Quaternion Debug Information\n"); 599 PRINT(0)("real a=%f; imag: x=%f y=%f z=%f\n", w, v.x, v.y, v.z); 600 } 601 602 /** 583 603 \brief create a rotation from a vector 584 604 \param v: a vector -
orxonox/trunk/src/lib/math/vector.h
r3473 r3541 41 41 Vector* getNormalized(); 42 42 Vector abs(); 43 44 void debug(); 43 45 }; 44 46 … … 53 55 { 54 56 public: 55 Vector v; //!< Imaginary Vector 56 float w; //!< Real part of the number 57 58 Quaternion (); 59 Quaternion (float m[4][4]); 60 Quaternion (float angle, const Vector& axis); 61 Quaternion (const Vector& dir, const Vector& up); 62 Quaternion (float roll, float pitch, float yaw); 63 64 Quaternion operator/ (const float& f) const; 65 Quaternion operator* (const float& f) const; 66 Quaternion operator* (const Quaternion& q) const; 67 Quaternion operator+ (const Quaternion& q) const; 68 Quaternion operator- (const Quaternion& q) const; 69 Quaternion conjugate () const; 70 Quaternion inverse () const; 71 Vector apply (Vector& f) const; 72 float norm () const; 73 void matrix (float m[4][4]) const; 74 void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res); 75 57 Vector v; //!< Imaginary Vector 58 float w; //!< Real part of the number 59 60 Quaternion (); 61 Quaternion (float m[4][4]); 62 Quaternion (float angle, const Vector& axis); 63 Quaternion (const Vector& dir, const Vector& up); 64 Quaternion (float roll, float pitch, float yaw); 65 66 Quaternion operator/ (const float& f) const; 67 Quaternion operator* (const float& f) const; 68 Quaternion operator* (const Quaternion& q) const; 69 Quaternion operator+ (const Quaternion& q) const; 70 Quaternion operator- (const Quaternion& q) const; 71 Quaternion conjugate () const; 72 Quaternion inverse () const; 73 Vector apply (Vector& f) const; 74 float norm () const; 75 void matrix (float m[4][4]) const; 76 void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res); 77 78 void debug(); 76 79 private: 77 80 float DELTA; //!< resolution of calculation 78 81 79 82 };
Note: See TracChangeset
for help on using the changeset viewer.