Changeset 1559 for code/trunk/src/orxonox/objects/WorldEntity.cc
- Timestamp:
- Jun 7, 2008, 2:34:54 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/WorldEntity.cc
r1558 r1559 45 45 unsigned int WorldEntity::worldEntityCounter_s = 0; 46 46 47 WorldEntity::WorldEntity() : 48 velocity_ (0, 0, 0), 49 acceleration_(0, 0, 0), 50 rotationAxis_(0, 1, 0), 51 rotationRate_(0), 52 momentum_ (0), 53 node_ (0), 54 bStatic_ (true) 47 WorldEntity::WorldEntity() 55 48 { 56 49 RegisterObject(WorldEntity); … … 58 51 if (GraphicsEngine::getSingleton().getSceneManager()) 59 52 { 60 std::ostringstream name;61 name << (WorldEntity::worldEntityCounter_s++);62 this->setName("WorldEntity" + name.str());63 this->node_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());53 std::ostringstream name; 54 name << (WorldEntity::worldEntityCounter_s++); 55 this->setName("WorldEntity" + name.str()); 56 this->node_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 64 57 65 registerAllVariables();58 registerAllVariables(); 66 59 } 60 else 61 { 62 this->node_ = 0; 63 } 64 65 this->bStatic_ = true; 66 this->velocity_ = Vector3(0, 0, 0); 67 this->acceleration_ = Vector3(0, 0, 0); 68 this->rotationAxis_ = Vector3(0, 1, 0); 69 this->rotationRate_ = 0; 70 this->momentum_ = 0; 67 71 } 68 72 … … 70 74 WorldEntity::~WorldEntity() 71 75 { 72 // just to make sure we clean out all scene nodes 73 if(this->getNode()) 76 if (this->isInitialized()) 74 77 { 75 78 this->getNode()->removeAndDestroyAllChildren();
Note: See TracChangeset
for help on using the changeset viewer.