Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3249 in orxonox.OLD for orxonox/branches/parenting


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

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

Location:
orxonox/branches/parenting/src
Files:
5 edited

Legend:

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

    r2190 r3249  
    1919using namespace std;
    2020
     21long DataTank::timeStamp = 0;
     22
    2123DataTank::DataTank () {}
    2224DataTank::~DataTank () {}
  • orxonox/branches/parenting/src/data_tank.h

    r3224 r3249  
    1010  ~DataTank ();
    1111
     12  static long timeStamp;
     13
    1214};
    1315
  • 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
  • orxonox/branches/parenting/src/p_node.h

    r3248 r3249  
    5353  void removeChild (PNode* pNode);
    5454  void setParent (PNode* parent);
    55   void update ();
     55  void update (long timeStamp);
    5656
    5757 private:
  • orxonox/branches/parenting/src/stdincl.h

    r3224 r3249  
    3838#include "message_structures.h"
    3939#include "orxonox.h"
     40#include "data_tank.h"
    4041
    4142#endif /* _STDINCL_H */
Note: See TracChangeset for help on using the changeset viewer.