Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Oct 19, 2005, 6:30:07 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: update the Element2D-tree in the right order

File:
1 edited

Legend:

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

    r5397 r5406  
    1212   main-programmer: Patrick Boenzli
    1313   co-programmer:
    14 
    15    @todo Smooth-Parent: delay, speed
    1614*/
    1715
     
    3129#include "vector.h"
    3230
    33 //#include "vector.h"
    34 //#include "quaternion.h"
     31#include "color.h"
    3532
    3633using namespace std;
     
    278275  this->setAbsCoor(Vector(x, y, z));
    279276}
     277
     278/**
     279 * @param absCoord set absolute coordinate
     280 * @todo check off
     281 */
     282void PNode::setAbsCoorSoft (const Vector& absCoordSoft, float bias)
     283{
     284  if (this->toCoordinate == NULL)
     285    this->toCoordinate = new Vector;
     286
     287  if( likely(this->parentMode & PNODE_MOVEMENT))
     288  {
     289      /* if you have set the absolute coordinates this overrides all other changes */
     290    if (likely(this->parent != NULL))
     291      *this->toCoordinate = absCoordSoft - parent->getAbsCoor ();
     292    else
     293      *this->toCoordinate = absCoordSoft;
     294  }
     295  if( this->parentMode & PNODE_ROTATE_MOVEMENT)
     296  {
     297    if (likely(this->parent != NULL))
     298      *this->toCoordinate = absCoordSoft - parent->getAbsCoor ();
     299    else
     300      *this->toCoordinate = absCoordSoft;
     301  }
     302}
     303
    280304
    281305/**
     
    695719  }
    696720}
    697 #include "color.h"
    698721
    699722/**
     
    767790    {
    768791      // drawing the Dependency graph
    769       if (this != NullParent::getInstance())
     792     if (this != NullParent::getInstance())
    770793      {
    771794       glBegin(GL_LINES);
Note: See TracChangeset for help on using the changeset viewer.