Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 24, 2004, 4:34:14 PM (19 years ago)
Author:
patrick
Message:

orxonox/branches/parenting: parenting now debugged, ready to be integrated into the framework.

File:
1 edited

Legend:

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

    r3265 r3269  
    4848{
    4949  this->absCoordinate = *absCoordinate;
    50   this->relCoordinate = this->absCoordinate - this->parent->getAbsCoor ();
    51  
     50  this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
    5251 
    5352  this->children = new tList<PNode>();
    54   this->bRelCoorChanged = false;
    55   this->bAbsCoorChanged = true;
     53  this->bRelCoorChanged = true;
     54  this->bAbsCoorChanged = false;
    5655  this->bRelDirChanged = true;
    5756  this->bAbsDirChanged = false;
     
    9392   has changed and won't update the children Nodes.
    9493*/
    95 void PNode::setRelCoor (Vector relCoord)
    96 {
    97   this->bRelCoorChanged = true;
    98   this->relCoordinate = relCoord;
     94void PNode::setRelCoor (Vector* relCoord)
     95{
     96  this->bRelCoorChanged = true;
     97  this->relCoordinate = *relCoord;
    9998}
    10099
     
    118117   has changed and won't update the children Nodes.
    119118*/
    120 void PNode::setAbsCoor (Vector absCoord)
     119void PNode::setAbsCoor (Vector* absCoord)
    121120{
    122121  this->bAbsCoorChanged = true;
    123   this->absCoordinate = absCoord;
     122  this->absCoordinate = *absCoord;
    124123}
    125124
     
    183182   has changed and won't update the children Nodes.
    184183*/
    185 void PNode::setRelDir (Quaternion relDir)
    186 {
    187   this->bRelCoorChanged = true;
    188   this->relDirection = relDir;
     184void PNode::setRelDir (Quaternion* relDir)
     185{
     186  this->bRelCoorChanged = true;
     187  this->relDirection = *relDir;
    189188}
    190189
     
    206205   has changed and won't update the children Nodes.
    207206*/
    208 void PNode::setAbsDir (Quaternion absDir)
     207void PNode::setAbsDir (Quaternion* absDir)
    209208{}
    210209
     
    320319void PNode::update (long timeStamp)
    321320{
    322   printf("PNode::update() \n");
    323   //if( this->parent != NULL)
    324   //    {
    325321     
    326322      if( this->mode == MOVEMENT || this->mode == ALL)
     
    328324          if( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
    329325            {
     326              printf("PNode::update () - this->bAbsCoorChanged = true\n");
    330327              /* if you have set the absolute coordinates this overrides all other changes */
    331328              this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     
    333330          else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
    334331            {
    335  printf("PNode::update() - inside: before: absCoord: (%f, %f, %f)\n",
    336          this->absCoordinate.x,
    337          this->absCoordinate.y,
    338          this->absCoordinate.z);
    339 printf("PNode::update() - inside: before: relCoord: (%f, %f, %f)\n",
    340          this->relCoordinate.x,
    341          this->relCoordinate.y,
    342          this->relCoordinate.z);
    343332              /*this is bad style... must be deleted later - just for testing*/
    344333              if( this->parent == NULL)
    345334                {
    346335                this->absCoordinate = this->relCoordinate;
    347                 printf("PNode::update() - insinde: NULL NULL NULL\n");
    348336                }
    349337              else
    350338                this->absCoordinate = parent->getAbsCoor () + this->relCoordinate;            /* update the current absCoordinate */
    351  printf("PNode::update() - inside after: absCoord: (%f, %f, %f)\n",
    352          this->absCoordinate.x,
    353          this->absCoordinate.y,
    354          this->absCoordinate.z);
    355 printf("PNode::update() - inside after: relCoord: (%f, %f, %f)\n",
    356          this->relCoordinate.x,
    357          this->relCoordinate.y,
    358          this->relCoordinate.z);
    359339            }
    360340        }
Note: See TracChangeset for help on using the changeset viewer.