Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5000 in orxonox.OLD for orxonox/trunk/src/lib/coord/p_node.cc


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

File:
1 edited

Legend:

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

    r4998 r5000  
    483483  parentNode->addChild(this);
    484484
    485 /* if (this->parentMode & PNODE_ROTATE_MOVEMENT)
    486   this->setRelCoor(parent->getRelDir().apply(tmpV - parent->getAbsCoor()));
    487   else*/
    488   this->setRelCoor(tmpV - parentNode->getAbsCoor());
     485 if (this->parentMode & PNODE_ROTATE_MOVEMENT)
     486   this->setRelCoor(this->parent->getAbsDir().inverse().apply(tmpV - this->parent->getAbsCoor()));
     487 else
     488   this->setRelCoor(tmpV - parentNode->getAbsCoor());
    489489
    490490  this->setRelDir(tmpQ / parentNode->getAbsDir());
     
    542542      if (unlikely(this->toDirection != NULL))
    543543      {
    544         Quaternion rotQuat = Quaternion(.1, Vector(0,1,0));// (*this->toDirection / this->relDirection);
     544        Quaternion rotQuat = (*this->toDirection / this->relDirection)*dt;
    545545//         printf("1: ");
    546546//         this->relDirection.debug();
    547547//         printf("2: ");
    548548//         this->toDirection->debug();
    549 //         printf("3: ");
    550 //         rotQuat.debug();
    551 
    552         if (true)//likely(rotQuat.len() >= .001))
     549        //printf("3: ");
     550        //rotQuat.debug2();
     551
     552        if (likely(rotQuat.getSpacialAxisAngle() >= .01))
    553553        {
    554554          this->shiftDir(rotQuat);
     
    556556        else
    557557        {
    558           delete this->toCoordinate;
    559           this->toCoordinate = NULL;
    560           PRINTF(5)("SmoothMove of %s finished\n", this->getName());
     558          delete this->toDirection;
     559          this->toDirection = NULL;
     560          PRINTF(5)("SmoothRotate of %s finished\n", this->getName());
    561561        }
    562562      }
Note: See TracChangeset for help on using the changeset viewer.