- Timestamp:
- Feb 14, 2009, 10:17:35 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/Billboard.cc
r2171 r2662 30 30 #include "Billboard.h" 31 31 32 #include <OgreBillboardSet.h> 33 32 34 #include "core/CoreIncludes.h" 33 35 #include "core/XMLPort.h" 36 #include "core/Core.h" 34 37 #include "objects/Scene.h" 35 38 … … 38 41 CreateFactory(Billboard); 39 42 40 Billboard::Billboard(BaseObject* creator) : PositionableEntity(creator)43 Billboard::Billboard(BaseObject* creator) : StaticEntity(creator) 41 44 { 42 45 RegisterObject(Billboard); 46 47 this->material_ = ""; 48 this->colour_ = ColourValue::White; 43 49 44 50 this->registerVariables(); … … 50 56 { 51 57 if (this->isInitialized() && this->billboard_.getBillboardSet()) 52 this-> getNode()->detachObject(this->billboard_.getName());58 this->detachOgreObject(this->billboard_.getBillboardSet()); 53 59 } 54 60 } … … 64 70 void Billboard::registerVariables() 65 71 { 66 REGISTERSTRING(this->material_, direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));67 REGISTERDATA (this->colour_, direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));72 registerVariable(this->material_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial)); 73 registerVariable(this->colour_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour)); 68 74 } 69 75 70 76 void Billboard::changedMaterial() 71 77 { 78 if (this->material_ == "") 79 return; 80 72 81 if (!this->billboard_.getBillboardSet()) 73 82 { 74 if (this->getScene() && this->getScene()->getSceneManager())83 if (this->getScene() && Core::showsGraphics()) 75 84 { 76 85 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); 77 86 if (this->billboard_.getBillboardSet()) 78 this->getNode()->attachObject(this->billboard_.getBillboardSet());87 this->attachOgreObject(this->billboard_.getBillboardSet()); 79 88 this->billboard_.setVisible(this->isVisible()); 80 89 } … … 88 97 if (!this->billboard_.getBillboardSet()) 89 98 { 90 if (this->getScene() && this->getScene()->getSceneManager()) 99 /* 100 if (this->getScene() && Core::showsGraphics() && (this->material_ != "")) 91 101 { 92 102 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); 93 103 if (this->billboard_.getBillboardSet()) 94 this-> getNode()->attachObject(this->billboard_.getBillboardSet());104 this->attachOgreObject(this->billboard_.getBillboardSet()); 95 105 this->billboard_.setVisible(this->isVisible()); 96 106 } 107 */ 97 108 } 98 109 else
Note: See TracChangeset
for help on using the changeset viewer.