Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5000 in orxonox.OLD for orxonox/trunk/src/lib/math


Ignore:
Timestamp:
Aug 13, 2005, 9:07:56 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: smooth-rotation is better now
PNODE_MOVEMENT_ROTATE-children are correcly smooth-reparented
some other minor fixes

THIS IS 5000 :)
so
generated the endOfTheWorld-function
implemented de-generic recapitualisation Procedures
imported magnificizer
dezentralized obscurities
some other minor stuff
flush
eliminated deamons

man… i must have to much time

Location:
orxonox/trunk/src/lib/math
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/math/vector.cc

    r4999 r5000  
    282282}
    283283
     284void 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
    284290/**
    285291 *  create a rotation from a vector
  • orxonox/trunk/src/lib/math/vector.h

    r4999 r5000  
    157157  inline Quaternion conjugate () const { return Quaternion(Vector(-v.x, -v.y, -v.z), this->w); };
    158158  /** @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); };
    160160  /** @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); };
    162162  /** @param v: the Vector  @return a new Vector representing v rotated by the Quaternion */
    163163  inline Vector apply (const Vector& v) const { return (*this * Quaternion(v, 0) * conjugate()).v; };
     
    176176
    177177  void debug();
     178  void debug2();
    178179
    179180
Note: See TracChangeset for help on using the changeset viewer.