Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5006 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Aug 14, 2005, 1:50:16 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: quatlerping works very good.
some speed-issues, exactity, etc…

Location:
orxonox/trunk/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/coord/p_node.cc

    r5005 r5006  
    528528        Vector moveVect = (*this->toCoordinate - this->getRelCoor()) *dt*bias;
    529529
    530         if (likely(moveVect.len() >= .001))
     530        if (likely(moveVect.len() >= PNODE_ITERATION_DELTA))
    531531        {
    532532          this->shiftCoor(moveVect);
     
    541541      if (unlikely(this->toDirection != NULL))
    542542      {
    543         Quaternion rotQuat = Quaternion::quatSlerp(Quaternion(0, Vector(0,1,0)), (*this->toDirection / this->relDirection), dt*this->bias);
    544 //         printf("1: ");
    545 //         this->relDirection.debug();
    546 //         printf("2: ");
    547 //         this->toDirection->debug();
    548         printf("3: ");
    549         rotQuat.debug2();
    550 
    551         if (likely(rotQuat.getSpacialAxisAngle() >= .01))
     543        Quaternion rotQuat = Quaternion::quatSlerp(Quaternion(), (*this->toDirection / this->relDirection), dt*this->bias);
     544        if (likely(rotQuat.getSpacialAxisAngle() > PNODE_ITERATION_DELTA))
    552545        {
    553546          this->shiftDir(rotQuat);
     
    557550          delete this->toDirection;
    558551          this->toDirection = NULL;
    559           PRINTF(5)("SmoothRotate of %s finished\n", this->getName());
     552          PRINTF(0)("SmoothRotate of %s finished\n", this->getName());
    560553        }
    561554      }
  • orxonox/trunk/src/lib/coord/p_node.h

    r5000 r5006  
    2525#include "vector.h"
    2626
     27
     28
    2729// FORWARD DEFINITION \\
    2830class TiXmlElement;
    2931template<class T> class tList;
    3032
     33#define PNODE_ITERATION_DELTA    .001
    3134//! Parental linkage modes
    3235typedef enum
  • orxonox/trunk/src/lib/math/vector.h

    r5001 r5006  
    136136                                                                         this->w*q.v.y + this->v.y*q.w + this->v.z*q.v.x - this->v.x*q.v.z,
    137137                                                                         this->w*q.v.z + this->v.z*q.w + this->v.x*q.v.y - this->v.y*q.v.x),
    138                                                                          this->w*q.w - this->v.x*q.v.x - this->v.y*q.v.y - this->v.z*q.v.z);
    139   };
     138                                                                         this->w*q.w - this->v.x*q.v.x - this->v.y*q.v.y - this->v.z*q.v.z); };
    140139  /** @param q: the Quaternion to multiply by @returns the quaternion multiplied by q (this *= q) */
    141140  inline const Quaternion& operator*= (const Quaternion& q) {*this = *this * q; return *this; };
Note: See TracChangeset for help on using the changeset viewer.