Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3249 in orxonox.OLD for orxonox/branches/parenting/src/p_node.cc


Ignore:
Timestamp:
Dec 22, 2004, 4:50:54 PM (19 years ago)
Author:
patrick
Message:

oroxnox/branches/parenting: implemented some functions like update(), should now incremently go through the PNode tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/p_node.cc

    r3248 r3249  
    3131{
    3232  this->children = new tList<PNode>();
     33  this->bCoorChanged = true;
     34  this->bDirChanged = true;
    3335}
    3436
     
    230232   worry, normaly...
    231233*/
    232 void PNode::update()
    233 {
     234void PNode::update(long timeStamp)
     235{
     236  if(this->parent == NULL)
     237    printf("PNode::upate(long timeStamp) - parent is NULL...");
     238  if( this->bCoorChanged && this->timeStamp != DataTank::timeStamp)
     239    {
     240      /* update the current absCoordinate */
     241      this->absCoordinate = parent->getAbsCoor () + this->relCoordinate;
     242    }
     243  if( this->bDirChanged && this->timeStamp != DataTank::timeStamp)
     244    {
     245      /* update the current absDirection - remember * means rotation around sth.*/
     246      this->absDirection = parent->getAbsDir () * this->relDirection;
     247    }
    234248 
    235 }
    236 
     249  PNode* pn = this->children->enumerate();
     250  while( pn != NULL)
     251    {
     252      pn->update(timeStamp);
     253      pn = this->children->nextElement();
     254    }
     255
     256  this->timeStamp = timeStamp;
     257  this->bCoorChanged = false;
     258  this->bDirChanged = false;
     259
     260}
     261
Note: See TracChangeset for help on using the changeset viewer.