Changeset 3277 in orxonox.OLD for orxonox/branches/parenting
- Timestamp:
- Dec 25, 2004, 1:44:31 AM (20 years ago)
- Location:
- orxonox/branches/parenting/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/p_node.cc
r3276 r3277 69 69 PNode::~PNode () 70 70 { 71 this->children->destroy(); 72 delete this->children; 71 /* 72 delete &this->children; 73 delete &this->relCoordinate; 74 delete &this->absCoordinate; 75 delete &this->relDirection; 76 delete &this->absDirection; 77 */ 78 this->parent = NULL; 79 /* there is currently a problem with cleaning up - fix*/ 80 } 81 82 83 /** 84 \brief deletes the hole pnode tree 85 86 cleans up all pnodes 87 */ 88 void PNode::destroy () 89 { 90 PNode* pn = this->children->enumerate(); 91 while( pn != NULL) 92 { 93 pn->destroy (); 94 pn = this->children->nextElement(); 95 } 96 this->children->destroy (); 73 97 } 74 98 -
orxonox/branches/parenting/src/p_node.h
r3276 r3277 34 34 PNode (); 35 35 PNode (Vector* absCoordinate, PNode* pNode); 36 ~PNode (); 36 virtual ~PNode (); 37 38 void destroy (); 37 39 38 40 PNode* parent; //! a pointer to the parent node -
orxonox/branches/parenting/src/world.cc
r3276 r3277 67 67 this->entities->destroy(); 68 68 69 /* FIX the parent list has to be cleared - not possible if we got the old list also*/ 70 //this->nullParent->destroy (); 71 69 72 delete this->entities; 70 73 delete this->localCamera; … … 82 85 83 86 /* this is only for test purposes */ 84 //this->debug ();87 this->debug (); 85 88 } 86 89 … … 128 131 case DEBUG_WORLD_0: 129 132 { 133 this->nullParent = new NullParent (); 134 130 135 // create some path nodes 131 136 this->pathnodes = new Vector[6]; … … 146 151 // !\todo old track-system has to be removed 147 152 148 //this->nullParent = new NullParent ();149 150 153 // create a player 151 154 WorldEntity* myPlayer = new Player(); … … 160 163 this->localCamera = new Camera(this); 161 164 this->getCamera()->bind (myPlayer); 162 165 166 /* 163 167 Placement* plc = new Placement; 164 168 plc->r = Vector(100, 10, 10); … … 166 170 WorldEntity* env = new Environment(); 167 171 this->spawn(env, plc); 172 */ 168 173 169 174 break; … … 171 176 case DEBUG_WORLD_1: 172 177 { 178 this->nullParent = new NullParent (); 179 173 180 // create some path nodes 174 181 this->pathnodes = new Vector[6]; … … 622 629 p3->debug (); 623 630 p4->debug (); 631 632 p1->destroy (); 633 634 624 635 /* 625 636 WorldEntity* entity; … … 778 789 WorldEntity* owner; 779 790 791 if( this->nullParent != NULL) 792 this->nullParent->addChild (entity); 793 780 794 entities->add (entity); 781 795 zeroloc.dist = 0; … … 800 814 void World::spawn(WorldEntity* entity, Location* loc) 801 815 { 816 if( this->nullParent != NULL) 817 this->nullParent->addChild (entity); 818 802 819 Location zeroLoc; 803 820 WorldEntity* owner; … … 828 845 void World::spawn(WorldEntity* entity, Placement* plc) 829 846 { 847 if( this->nullParent != NULL) 848 this->nullParent->addChild (entity); 849 830 850 Placement zeroPlc; 831 851 WorldEntity* owner; -
orxonox/branches/parenting/src/world_entity.h
r3229 r3277 8 8 9 9 #include "stdincl.h" 10 #include "p_node.h" 10 11 11 12 class CollisionCluster; 12 13 13 14 //! Basic class from which all interactive stuff in the world is derived from 14 class WorldEntity 15 class WorldEntity : public PNode 15 16 { 16 17 friend class World; 17 18 18 19 public: 19 20 WorldEntity (bool isFree = false); 20 21 virtual ~WorldEntity (); 21 22 23 //PNode* pNode; 22 24 Location* getLocation (); 23 25 Placement* getPlacement ();
Note: See TracChangeset
for help on using the changeset viewer.