Changeset 9407 for code/branches/shaders/src/orxonox/graphics
- Timestamp:
- Oct 21, 2012, 5:32:00 PM (12 years ago)
- Location:
- code/branches/shaders/src/orxonox/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/shaders/src/orxonox/graphics/Model.cc
r9402 r9407 44 44 45 45 Model::Model(BaseObject* creator) : 46 StaticEntity(creator), bCastShadows_(true), lodLevel_(5), bLodEnabled_(true), numLodLevels_(10), lodReductionRate_(.15f)46 StaticEntity(creator), bCastShadows_(true), renderQueueGroup_(RENDER_QUEUE_STENCIL_OBJECTS), lodLevel_(5), bLodEnabled_(true), numLodLevels_(10), lodReductionRate_(.15f) 47 47 { 48 48 RegisterObject(Model); … … 71 71 72 72 XMLPortParam(Model, "mesh", setMeshSource, getMeshSource, xmlelement, mode); 73 XMLPortParam(Model, "renderQueueGroup", setRenderQueueGroup, getRenderQueueGroup, xmlelement, mode); 73 74 XMLPortParam(Model, "material", setMaterial, getMaterial, xmlelement, mode); 74 75 XMLPortParam(Model, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true); … … 78 79 { 79 80 registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedMesh)); 81 registerVariable(this->renderQueueGroup_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedRenderQueueGroup)); 82 registerVariable(this->materialName_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedMaterial)); 80 83 registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedShadows)); 81 84 } … … 108 111 if (this->bGlobalEnableLod_) 109 112 this->enableLod(); 113 } 114 } 115 } 116 117 void Model::changedRenderQueueGroup() 118 { 119 if (GameMode::showsGraphics()) 120 { 121 if (this->mesh_.getEntity()) 122 { 123 this->mesh_.getEntity()->setRenderQueueGroup(this->renderQueueGroup_); 110 124 } 111 125 } -
code/branches/shaders/src/orxonox/graphics/Model.h
r9402 r9407 34 34 #include <string> 35 35 #include "tools/Mesh.h" 36 #include "RenderQueueListener.h" 36 37 #include "worldentities/StaticEntity.h" 37 38 … … 58 59 { return this->meshSrc_; } 59 60 61 //TODO: let this function accept strings instead of ints for the XML Port, so we don't have to rely on static int values which may change in future Ogre revisions 62 inline void setRenderQueueGroup(const int renderQueueGroup) 63 { this->renderQueueGroup_ = renderQueueGroup; this->changedRenderQueueGroup(); } 64 inline const int getRenderQueueGroup() const 65 { return this->renderQueueGroup_; } 66 60 67 inline void setCastShadows(bool bCastShadows) 61 68 { this->bCastShadows_ = bCastShadows; this->changedShadows(); } … … 71 78 void registerVariables(); 72 79 void changedMesh(); 80 void changedRenderQueueGroup(); 73 81 void changedMaterial(); 74 82 void changedShadows(); … … 86 94 Mesh mesh_; 87 95 bool bCastShadows_; 96 int renderQueueGroup_; 88 97 std::string materialName_; 89 98
Note: See TracChangeset
for help on using the changeset viewer.