Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3269 in orxonox.OLD


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.

Location:
orxonox/branches/parenting/src
Files:
3 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        }
  • orxonox/branches/parenting/src/p_node.h

    r3265 r3269  
    4242
    4343  Vector getRelCoor ();
    44   void setRelCoor (Vector relCoord);
     44  void setRelCoor (Vector* relCoord);
    4545  Vector getAbsCoor ();
    46   void setAbsCoor (Vector absCoord);
     46  void setAbsCoor (Vector* absCoord);
    4747  void shiftCoor (Vector* shift);
    4848
    4949  Quaternion getRelDir ();
    50   void setRelDir (Quaternion relDir);
     50  void setRelDir (Quaternion* relDir);
    5151  Quaternion getAbsDir ();
    52   void setAbsDir (Quaternion absDir);
     52  void setAbsDir (Quaternion* absDir);
    5353  void shiftDir (Quaternion* shift);
    5454
  • orxonox/branches/parenting/src/world.cc

    r3265 r3269  
    575575void World::debug()
    576576{
    577   printf("World::debug() - starting debug\n");
     577  printf ("World::debug() - starting debug\n");
    578578  PNode* p1 = new PNode ();
    579579  PNode* p2 = new PNode (new Vector(2, 2, 2), p1);
     
    602602  p1->update (1);
    603603
    604   printf("World::debug() - update\n");
     604  printf ("World::debug() - update\n");
    605605  p1->debug ();
    606606  p2->debug ();
     
    608608  p4->debug ();
    609609
    610 
     610  p2->shiftCoor (new Vector(-1, -1, -1));
     611  p1->update (2);
     612
     613  p1->debug ();
     614  p2->debug ();
     615  p3->debug ();
     616  p4->debug ();
     617
     618  p2->setAbsCoor (new Vector(1,2,3));
     619
     620
     621 p1->update (2);
     622
     623  p1->debug ();
     624  p2->debug ();
     625  p3->debug ();
     626  p4->debug ();
    611627  /*
    612628  WorldEntity* entity;
Note: See TracChangeset for help on using the changeset viewer.