Changeset 3269 in orxonox.OLD for orxonox/branches/parenting
- Timestamp:
- Dec 24, 2004, 4:34:14 PM (20 years ago)
- Location:
- orxonox/branches/parenting/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/p_node.cc
r3265 r3269 48 48 { 49 49 this->absCoordinate = *absCoordinate; 50 this->relCoordinate = this->absCoordinate - this->parent->getAbsCoor (); 51 50 this->relCoordinate = this->absCoordinate - parent->getAbsCoor (); 52 51 53 52 this->children = new tList<PNode>(); 54 this->bRelCoorChanged = false;55 this->bAbsCoorChanged = true;53 this->bRelCoorChanged = true; 54 this->bAbsCoorChanged = false; 56 55 this->bRelDirChanged = true; 57 56 this->bAbsDirChanged = false; … … 93 92 has changed and won't update the children Nodes. 94 93 */ 95 void PNode::setRelCoor (Vector relCoord)96 { 97 this->bRelCoorChanged = true; 98 this->relCoordinate = relCoord;94 void PNode::setRelCoor (Vector* relCoord) 95 { 96 this->bRelCoorChanged = true; 97 this->relCoordinate = *relCoord; 99 98 } 100 99 … … 118 117 has changed and won't update the children Nodes. 119 118 */ 120 void PNode::setAbsCoor (Vector absCoord)119 void PNode::setAbsCoor (Vector* absCoord) 121 120 { 122 121 this->bAbsCoorChanged = true; 123 this->absCoordinate = absCoord;122 this->absCoordinate = *absCoord; 124 123 } 125 124 … … 183 182 has changed and won't update the children Nodes. 184 183 */ 185 void PNode::setRelDir (Quaternion relDir)186 { 187 this->bRelCoorChanged = true; 188 this->relDirection = relDir;184 void PNode::setRelDir (Quaternion* relDir) 185 { 186 this->bRelCoorChanged = true; 187 this->relDirection = *relDir; 189 188 } 190 189 … … 206 205 has changed and won't update the children Nodes. 207 206 */ 208 void PNode::setAbsDir (Quaternion absDir)207 void PNode::setAbsDir (Quaternion* absDir) 209 208 {} 210 209 … … 320 319 void PNode::update (long timeStamp) 321 320 { 322 printf("PNode::update() \n");323 //if( this->parent != NULL)324 // {325 321 326 322 if( this->mode == MOVEMENT || this->mode == ALL) … … 328 324 if( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/) 329 325 { 326 printf("PNode::update () - this->bAbsCoorChanged = true\n"); 330 327 /* if you have set the absolute coordinates this overrides all other changes */ 331 328 this->relCoordinate = this->absCoordinate - parent->getAbsCoor (); … … 333 330 else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/) 334 331 { 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);343 332 /*this is bad style... must be deleted later - just for testing*/ 344 333 if( this->parent == NULL) 345 334 { 346 335 this->absCoordinate = this->relCoordinate; 347 printf("PNode::update() - insinde: NULL NULL NULL\n");348 336 } 349 337 else 350 338 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);359 339 } 360 340 } -
orxonox/branches/parenting/src/p_node.h
r3265 r3269 42 42 43 43 Vector getRelCoor (); 44 void setRelCoor (Vector relCoord);44 void setRelCoor (Vector* relCoord); 45 45 Vector getAbsCoor (); 46 void setAbsCoor (Vector absCoord);46 void setAbsCoor (Vector* absCoord); 47 47 void shiftCoor (Vector* shift); 48 48 49 49 Quaternion getRelDir (); 50 void setRelDir (Quaternion relDir);50 void setRelDir (Quaternion* relDir); 51 51 Quaternion getAbsDir (); 52 void setAbsDir (Quaternion absDir);52 void setAbsDir (Quaternion* absDir); 53 53 void shiftDir (Quaternion* shift); 54 54 -
orxonox/branches/parenting/src/world.cc
r3265 r3269 575 575 void World::debug() 576 576 { 577 printf ("World::debug() - starting debug\n");577 printf ("World::debug() - starting debug\n"); 578 578 PNode* p1 = new PNode (); 579 579 PNode* p2 = new PNode (new Vector(2, 2, 2), p1); … … 602 602 p1->update (1); 603 603 604 printf ("World::debug() - update\n");604 printf ("World::debug() - update\n"); 605 605 p1->debug (); 606 606 p2->debug (); … … 608 608 p4->debug (); 609 609 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 (); 611 627 /* 612 628 WorldEntity* entity;
Note: See TracChangeset
for help on using the changeset viewer.