- Timestamp:
- Feb 21, 2016, 10:21:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ogre1.9/src/orxonox/graphics/AnimatedModel.cc
r9667 r11126 49 49 AnimatedModel::~AnimatedModel() 50 50 { 51 if (this->isInitialized() && this-> mesh_.getEntity())52 this->detachOgreObject(this-> mesh_.getEntity());51 if (this->isInitialized() && this->getMesh().getEntity()) 52 this->detachOgreObject(this->getMesh().getEntity()); 53 53 } 54 54 … … 66 66 if (GameMode::showsGraphics()) 67 67 { 68 if (this-> mesh_.getEntity())69 this->detachOgreObject(this-> mesh_.getEntity());68 if (this->getMesh().getEntity()) 69 this->detachOgreObject(this->getMesh().getEntity()); 70 70 71 this-> mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);71 this->getMesh().setMeshSource(this->getScene()->getSceneManager(), this->getMeshSource()); 72 72 73 if (this-> mesh_.getEntity())73 if (this->getMesh().getEntity()) 74 74 { 75 this->attachOgreObject(this-> mesh_.getEntity());76 this-> mesh_.getEntity()->setCastShadows(this->bCastShadows_);75 this->attachOgreObject(this->getMesh().getEntity()); 76 this->getMesh().getEntity()->setCastShadows(this->getCastShadows()); 77 77 this->setAnimationState(this->bAnimLoop_, this->bAnimEnabled_, this->anims_); 78 this-> mesh_.setVisible(this->isVisible());78 this->getMesh().setVisible(this->isVisible()); 79 79 } 80 80 } … … 89 89 if(state!="") 90 90 { 91 if(this-> mesh_.getEntity()->getAnimationState(state))91 if(this->getMesh().getEntity()->getAnimationState(state)) 92 92 { 93 Ogre::AnimationState* as = this-> mesh_.getEntity()->getAnimationState(state);93 Ogre::AnimationState* as = this->getMesh().getEntity()->getAnimationState(state); 94 94 as->setLoop(loop); 95 95 as->setEnabled(enabled); … … 109 109 void AnimatedModel::tick(float dt) 110 110 { 111 if(this-> mesh_.getEntity()->getAnimationState(anims_))111 if(this->getMesh().getEntity()->getAnimationState(anims_)) 112 112 { 113 113 // Test to change Material at runtime! 114 114 115 // Ogre::MaterialPtr mat = this-> mesh_.getEntity()->getSubEntity(0)->getMaterial();115 // Ogre::MaterialPtr mat = this->getMesh().getEntity()->getSubEntity(0)->getMaterial(); 116 116 // mat->setDiffuse(0.4, 0.3, 0.1, 0.1); 117 117 // mat->setAmbient(0.3, 0.7, 0.8); … … 121 121 // mat->setSceneBlending(sbt); 122 122 123 Ogre::AnimationState* as = this-> mesh_.getEntity()->getAnimationState(anims_);123 Ogre::AnimationState* as = this->getMesh().getEntity()->getAnimationState(anims_); 124 124 as->addTime(dt); 125 125 }
Note: See TracChangeset
for help on using the changeset viewer.