Changeset 2296 for code/branches/physics/src
- Timestamp:
- Nov 29, 2008, 12:25:22 AM (16 years ago)
- Location:
- code/branches/physics/src/orxonox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/Billboard.cc
r2087 r2296 50 50 { 51 51 if (this->isInitialized() && this->billboard_.getBillboardSet()) 52 this-> getNode()->detachObject(this->billboard_.getName());52 this->detachOgreObject(this->billboard_.getName()); 53 53 } 54 54 } … … 75 75 { 76 76 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); 77 this-> getNode()->attachObject(this->billboard_.getBillboardSet());77 this->attachOgreObject(this->billboard_.getBillboardSet()); 78 78 this->billboard_.setVisible(this->isVisible()); 79 79 } … … 90 90 { 91 91 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); 92 this-> getNode()->attachObject(this->billboard_.getBillboardSet());92 this->attachOgreObject(this->billboard_.getBillboardSet()); 93 93 this->billboard_.setVisible(this->isVisible()); 94 94 } -
code/branches/physics/src/orxonox/objects/worldentities/Camera.cc
r2103 r2296 55 55 56 56 this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString()); 57 this-> getNode()->attachObject(this->camera_);57 this->attachOgreObject(this->camera_); 58 58 59 59 this->bHasFocus_ = false; -
code/branches/physics/src/orxonox/objects/worldentities/Light.cc
r2087 r2296 53 53 if (this->getScene() && this->getScene()->getSceneManager()) 54 54 this->light_ = this->getScene()->getSceneManager()->createLight("Light" + convertToString(Light::lightCounter_s++)); 55 this-> getNode()->attachObject(this->light_);55 this->attachOgreObject(this->light_); 56 56 57 57 this->registerVariables(); -
code/branches/physics/src/orxonox/objects/worldentities/Model.cc
r2087 r2296 48 48 { 49 49 if (this->isInitialized() && this->mesh_.getEntity()) 50 this-> getNode()->detachObject(this->mesh_.getEntity());50 this->detachOgreObject(this->mesh_.getEntity()); 51 51 } 52 52 … … 68 68 { 69 69 if (this->mesh_.getEntity()) 70 this-> getNode()->detachObject(this->mesh_.getEntity());70 this->detachOgreObject(this->mesh_.getEntity()); 71 71 72 72 this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_); … … 74 74 if (this->mesh_.getEntity()) 75 75 { 76 this-> getNode()->attachObject(this->mesh_.getEntity());76 this->attachOgreObject(this->mesh_.getEntity()); 77 77 this->mesh_.getEntity()->setCastShadows(this->bCastShadows_); 78 78 this->mesh_.setVisible(this->isVisible()); -
code/branches/physics/src/orxonox/objects/worldentities/ParticleEmitter.cc
r2087 r2296 61 61 { 62 62 if (this->isInitialized() && this->particles_) 63 { 64 this->detachOgreObject(this->particles_->getParticleSystem()); 63 65 delete this->particles_; 66 } 64 67 } 65 68 … … 104 107 { 105 108 this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), this->source_, this->LOD_); 106 this-> particles_->addToSceneNode(this->getNode());109 this->attachOgreObject(particles_->getParticleSystem()); 107 110 this->particles_->setVisible(this->isVisible()); 108 111 this->particles_->setEnabled(this->isActive()); -
code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h
r2292 r2296 61 61 void registerVariables(); 62 62 63 inline Ogre::SceneNode* getNode() const63 inline const Ogre::SceneNode* getNode() const 64 64 { return this->node_; } 65 65 … … 145 145 { return this->children_; } 146 146 147 inline void attachOgreObject(Ogre::MovableObject* object) 148 { this->node_->attachObject(object); } 149 inline void detachOgreObject(Ogre::MovableObject* object) 150 { this->node_->detachObject(object); } 151 inline Ogre::MovableObject* detachOgreObject(const Ogre::String& name) 152 { return this->node_->detachObject(name); } 153 147 154 inline void attachToParent(WorldEntity* parent) 148 155 { parent->attach(this); } -
code/branches/physics/src/orxonox/objects/worldentities/triggers/Trigger.cc
r2103 r2296 71 71 } 72 72 73 this-> getNode()->attachObject(this->debugBillboard_.getBillboardSet());73 this->attachOgreObject(this->debugBillboard_.getBillboardSet()); 74 74 this->setObjectMode(0x0); 75 75 } -
code/branches/physics/src/orxonox/tools/ParticleInterface.cc
r2087 r2296 56 56 57 57 this->scenemanager_ = scenemanager; 58 this->sceneNode_ = 0;59 58 60 59 this->bEnabled_ = true; … … 72 71 { 73 72 this->particleSystem_->removeAllEmitters(); 74 this->detachFromSceneNode();75 73 this->scenemanager_->destroyParticleSystem(particleSystem_); 76 }77 78 void ParticleInterface::addToSceneNode(Ogre::SceneNode* sceneNode)79 {80 if (this->sceneNode_)81 this->detachFromSceneNode();82 83 this->sceneNode_ = sceneNode;84 this->sceneNode_->attachObject(this->particleSystem_);85 }86 87 void ParticleInterface::detachFromSceneNode()88 {89 if (this->sceneNode_)90 {91 this->sceneNode_->detachObject(this->particleSystem_);92 this->sceneNode_ = 0;93 }94 74 } 95 75 -
code/branches/physics/src/orxonox/tools/ParticleInterface.h
r2087 r2296 54 54 { return this->particleSystem_; } 55 55 56 void addToSceneNode(Ogre::SceneNode* sceneNode);57 void detachFromSceneNode();58 59 56 Ogre::ParticleEmitter* createNewEmitter(); 60 57 Ogre::ParticleEmitter* getEmitter(unsigned int emitterNr) const; … … 96 93 static unsigned int counter_s; 97 94 98 Ogre::SceneNode* sceneNode_;99 95 Ogre::ParticleSystem* particleSystem_; 100 96 bool bVisible_;
Note: See TracChangeset
for help on using the changeset viewer.