Changeset 2006 for code/branches/objecthierarchy/src/orxonox/tools
- Timestamp:
- Oct 24, 2008, 2:48:43 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/tools/Mesh.cc
r1993 r2006 45 45 { 46 46 this->entity_ = 0; 47 this->bCastShadows_ = true; 47 48 } 48 49 … … 59 60 if (this->entity_) 60 61 GraphicsEngine::getInstance().getLevelSceneManager()->destroyEntity(this->entity_); 61 this->entity_ = GraphicsEngine::getInstance().getLevelSceneManager()->createEntity("Mesh" + convertToString(Mesh::meshCounter_s++), meshsource); 62 63 try 64 { 65 this->entity_ = GraphicsEngine::getInstance().getLevelSceneManager()->createEntity("Mesh" + convertToString(Mesh::meshCounter_s++), meshsource); 66 this->entity_->setCastShadows(this->bCastShadows_); 67 } 68 catch (...) 69 { 70 COUT(1) << "Error: Couln't load mesh \"" << meshsource << "\"" << std::endl; 71 } 62 72 } 73 } 74 75 void Mesh::setCastShadows(bool bCastShadows) 76 { 77 this->bCastShadows_ = bCastShadows; 78 if (this->entity_) 79 this->entity_->setCastShadows(this->bCastShadows_); 63 80 } 64 81 -
code/branches/objecthierarchy/src/orxonox/tools/Mesh.h
r1993 r2006 53 53 bool isVisible() const; 54 54 55 void setCastShadows(bool bCastShadows); 56 inline bool getCastShadows() const 57 { return this->bCastShadows_; } 58 55 59 private: 56 60 static unsigned int meshCounter_s; 57 61 Ogre::Entity* entity_; 62 bool bCastShadows_; 58 63 }; 59 64 }
Note: See TracChangeset
for help on using the changeset viewer.