Changeset 3529 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 13, 2005, 10:39:28 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/coord/null_parent.cc
r3488 r3529 36 36 \todo this constructor is not jet implemented - do it 37 37 */ 38 NullParent::NullParent () 38 NullParent::NullParent () : PNode("NullParent") 39 39 { 40 printf("NullParent::NullParent() - making new NullParent, there can only be one..\n"); 40 41 this->parent = this; 41 42 this->mode = ALL; 43 this->setName("NullParent"); 42 44 } 43 45 44 46 45 NullParent::NullParent (Vector* absCoordinate) 47 NullParent::NullParent (Vector* absCoordinate) : PNode("NullParent") 46 48 { 47 49 this->parent = this; 48 50 this->mode = ALL; 49 51 this->absCoordinate = *absCoordinate; 52 this->setName("NullParent"); 50 53 } 51 54 … … 58 61 NullParent::~NullParent () 59 62 { 60 delete singletonRef;63 //delete singletonRef; 61 64 singletonRef = NULL; 62 65 } -
orxonox/trunk/src/lib/coord/p_node.cc
r3521 r3529 40 40 this->bAbsDirChanged = false; 41 41 this->parent = NULL; 42 43 printf("PNode::PNode() - constructor, now adding\n"); 44 NullParent* np = NullParent::getInstance(); 45 np->addChild(this); 46 printf("PNode::PNode() - finished adding\n"); 42 47 } 43 48 … … 63 68 } 64 69 70 71 /** 72 \brief this constructor is very special. 73 \param with the name of the class 74 75 this constuctor exists, because there was a little issue with a 76 PNode<->NullPointer relation. It is crutial, that this construcor 77 exists, and is never used except from the NullParent itself. If you 78 delete it, there will probably be a endless loop, because in the 79 default constcutor of PNode NullPointer is generated, and NullPointer 80 gerenates itself again and again... 81 dont't think about it... 82 \todo patrick think about this one here... 83 */ 84 PNode::PNode(char* name) 85 { 86 printf("PNode::PNode(char*) - start\n"); 87 this->children = new tList<PNode>(); 88 this->bRelCoorChanged = true; 89 this->bAbsCoorChanged = false; 90 this->bRelDirChanged = true; 91 this->bAbsDirChanged = false; 92 this->parent = NULL; 93 printf("PNode::PNode(char*) - end\n"); 94 } 65 95 66 96 /** … … 96 126 pn = this->children->nextElement(); 97 127 } 128 /* this deletes all children in the list */ 98 129 this->children->destroy (); 99 130 } … … 280 311 void PNode::addChild (PNode* pNode, parentingMode mode) 281 312 { 282 if( pNode->parent == NULL )313 if( pNode->parent != NULL ) 283 314 { 284 p Node->mode = mode;285 pNode->parent = this;286 this->children->add(pNode);315 printf("PNode::addChild() - removing child from old parent \n"); 316 PRINTF(2)("PNode::addChild() - reparenting node: removing it and adding it again\n"); 317 pNode->parent->removeChild(pNode); 287 318 } 288 else289 {290 PRINTF(1)("PNode::addChild() - this node has already been added - closed Loop MARK \n");291 }319 pNode->mode = mode; 320 pNode->parent = this; 321 this->children->add(pNode); 322 printf("PNode::addChild() - Parent added\n"); 292 323 } 293 324 … … 358 389 void PNode::update (float timeStamp) 359 390 { 360 printf ("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 391 //printf ("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 392 // printf("%s", this->objectName); 361 393 362 394 if( this->mode == MOVEMENT || this->mode == ALL) -
orxonox/trunk/src/lib/coord/p_node.h
r3521 r3529 23 23 24 24 #include "stdincl.h" 25 25 26 26 27 class PNode; /* forward decleration, so that parentEntry has access to PNode */ … … 80 81 81 82 protected: 83 PNode(char*); 84 82 85 float timeStamp; //!< this the timeStamp of when the abs{Coordinat, Direction} has been calculated 83 86 char* objectName; //!< The name of the Object … … 95 98 96 99 #endif /* _P_NODE_H */ 100 -
orxonox/trunk/src/story_entities/world.cc
r3527 r3529 42 42 { 43 43 this->init(name, -1); 44 printf("World::World - generating Nullparent\n"); 45 NullParent* np = NullParent::getInstance(); 44 46 } 45 47 … … 67 69 68 70 this->localCamera->destroy(); 69 this->nullParent->destroy(); 71 this->nullParent->destroy(); 72 delete this->nullParent; 70 73 //delete this->skySphere; 71 74 … … 252 255 this->nullParent->setName ("NullParent"); 253 256 254 255 256 257 // create a player 257 258 WorldEntity* myPlayer = new Player(); … … 804 805 void World::spawn(WorldEntity* entity) 805 806 { 806 if( this->nullParent != NULL && entity->parent == NULL) 807 this->nullParent->addChild (entity); 808 807 this->nullParent->addChild (entity); 809 808 this->entities->add (entity); 810 811 809 entity->postSpawn (); 812 810 } … … 821 819 void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir) 822 820 { 821 this->nullParent->addChild (entity); 822 this->entities->add (entity); 823 823 824 entity->setAbsCoor (absCoor); 824 825 entity->setAbsDir (absDir); 825 826 if( this->nullParent != NULL && entity->parent == NULL)827 this->nullParent->addChild (entity);828 829 this->entities->add (entity);830 826 831 827 entity->postSpawn (); … … 845 841 { 846 842 847 if( parentNode != NULL && entity->parent == NULL)843 if( parentNode != NULL) 848 844 { 849 845 parentNode->addChild (entity);
Note: See TracChangeset
for help on using the changeset viewer.