- Timestamp:
- Oct 27, 2008, 4:08:51 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/worldentities/WorldEntity.cc
r2006 r2019 30 30 #include "WorldEntity.h" 31 31 32 #include <cassert> 32 33 #include <OgreSceneManager.h> 33 34 … … 37 38 38 39 #include "GraphicsEngine.h" 40 #include "objects/Scene.h" 39 41 40 42 namespace orxonox … … 47 49 const Vector3 WorldEntity::UP = Vector3::UNIT_Y; 48 50 49 WorldEntity::WorldEntity( )51 WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator) 50 52 { 51 53 RegisterObject(WorldEntity); 52 54 53 this->node_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(); 55 assert(this->getScene()); 56 assert(this->getScene()->getRootSceneNode()); 57 58 this->node_ = this->getScene()->getRootSceneNode()->createChildSceneNode(); 59 54 60 this->parent_ = 0; 55 61 this->parentID_ = (unsigned int)-1; … … 66 72 { 67 73 this->node_->detachAllObjects(); 68 GraphicsEngine::getInstance().getLevelSceneManager()->destroySceneNode(this->node_->getName()); 74 if (this->getScene()->getSceneManager()) 75 this->getScene()->getSceneManager()->destroySceneNode(this->node_->getName()); 69 76 } 70 77 } 71 72 78 73 79 void WorldEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode) … … 131 137 object->parentID_ = (unsigned int)-1; 132 138 133 GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->addChild(object->node_);139 this->getScene()->getRootSceneNode()->addChild(object->node_); 134 140 } 135 141
Note: See TracChangeset
for help on using the changeset viewer.