Changeset 7491
- Timestamp:
- Sep 26, 2010, 9:48:42 PM (14 years ago)
- Location:
- code/trunk/src/orxonox/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/graphics/Billboard.cc
r6417 r7491 29 29 #include "Billboard.h" 30 30 31 #include "OgreBillboard.h" 32 #include "OgreBillboardSet.h" 33 31 34 #include "core/CoreIncludes.h" 32 35 #include "core/GameMode.h" … … 43 46 44 47 this->colour_ = ColourValue::White; 45 //this->rotation_ = 0;48 this->rotation_ = 0; 46 49 47 50 this->registerVariables(); … … 63 66 XMLPortParam(Billboard, "material", setMaterial, getMaterial, xmlelement, mode); 64 67 XMLPortParam(Billboard, "colour", setColour, getColour, xmlelement, mode).defaultValues(ColourValue::White); 65 //XMLPortParam(Billboard, "rotation", setRotation, getRotation, xmlelement, mode).defaultValues(0);68 XMLPortParam(Billboard, "rotation", setRotation, getRotation, xmlelement, mode).defaultValues(0); 66 69 } 67 70 … … 70 73 registerVariable(this->material_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial)); 71 74 registerVariable(this->colour_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedColour)); 72 //registerVariable(this->rotation_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));75 registerVariable(this->rotation_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation)); 73 76 } 74 77 … … 86 89 this->attachOgreObject(this->billboard_.getBillboardSet()); 87 90 this->billboard_.setVisible(this->isVisible()); 88 //this->changedRotation();91 this->changedRotation(); 89 92 } 90 93 } … … 111 114 } 112 115 113 /*114 116 void Billboard::changedRotation() 115 117 { 116 118 if (this->billboard_.getBillboardSet()) 117 this->billboard_.getBillboardSet()->setRotation(this->rotation_); 119 { 120 Ogre::BillboardSet* set = this->billboard_.getBillboardSet(); 121 set->setBillboardRotationType(Ogre::BBR_VERTEX); 122 unsigned int size = set->getPoolSize(); 123 for(unsigned int i = 0; i < size; i++) 124 { 125 set->getBillboard(i)->setRotation(this->rotation_); 126 } 127 } 118 128 } 119 */120 129 121 130 void Billboard::changedVisibility() -
code/trunk/src/orxonox/graphics/Billboard.h
r7163 r7491 61 61 inline const ColourValue& getColour() const 62 62 { return this->colour_; } 63 /* 63 64 64 inline void setRotation(const Radian& rotation) 65 65 { this->rotation_ = rotation; this->changedRotation(); } 66 66 inline const Radian& getRotation() const 67 67 { return this->rotation_; } 68 */ 68 69 69 virtual void setTeamColour(const ColourValue& colour) 70 70 { this->setColour(colour); } … … 79 79 void registerVariables(); 80 80 void changedMaterial(); 81 //void changedRotation();81 void changedRotation(); 82 82 83 83 BillboardSet billboard_; 84 84 std::string material_; 85 85 ColourValue colour_; 86 //Radian rotation_;86 Radian rotation_; 87 87 }; 88 88 }
Note: See TracChangeset
for help on using the changeset viewer.