Changeset 11080 for code/trunk/src/orxonox/graphics/Model.h
- Timestamp:
- Jan 19, 2016, 11:27:40 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/graphics/Model.h
r11071 r11080 27 27 */ 28 28 29 /** 30 @file Model.h 31 @brief Definition of Model Class 32 */ 33 29 34 #ifndef _Model_H__ 30 35 #define _Model_H__ … … 34 39 #include <string> 35 40 #include "tools/Mesh.h" 41 #include "RenderQueueListener.h" 36 42 #include "worldentities/StaticEntity.h" 37 43 … … 40 46 class _OrxonoxExport Model : public StaticEntity 41 47 { 48 /** 49 @brief 50 The class Model stores a Mesh and some additional properties, so you can easily render any Model and apply different effects to it. 51 52 You can assign any Material to any Mesh to completely change the way it looks, to further add versatility you can also assign the Model 53 to a render queue group, to enable proper rendering of fancy effect like glowing edges around objects with alpha blending. 54 */ 42 55 public: 43 56 Model(Context* context); … … 58 71 { return this->meshSrc_; } 59 72 73 inline void setRenderQueueGroup(const std::string& renderQueueGroup) 74 { this->renderQueueGroup_ = getRenderQueueGroupID(renderQueueGroup); this->changedRenderQueueGroup(); } 75 inline const int getRenderQueueGroup() const 76 { return this->renderQueueGroup_; } 77 60 78 inline void setCastShadows(bool bCastShadows) 61 79 { this->bCastShadows_ = bCastShadows; this->changedShadows(); } … … 63 81 { return this->bCastShadows_; } 64 82 83 inline void setMaterial(const std::string& materialname) 84 { this->materialName_ = materialname; this->changedMaterial(); } 85 inline const std::string& getMaterial() const 86 { return this->materialName_; } 87 65 88 protected: 89 /** 90 @brief 91 This function turns a string from XML Port into a usable ID for the rendering system 92 It defaults to the main queue if the group isn't recognized. 93 94 @param renderQueueGroup 95 This is a string representing the render queue group. Accepted values: 96 main, stencil glow, stencil object 97 */ 98 const unsigned int getRenderQueueGroupID(const std::string& renderQueueGroup) const; 99 66 100 void registerVariables(); 67 101 void changedMesh(); 102 void changedRenderQueueGroup(); 103 void changedMaterial(); 68 104 void changedShadows(); 69 105 … … 77 113 float getBiggestScale(Vector3 scale3d); 78 114 79 std::string meshSrc_; 80 Mesh mesh_; 81 bool bCastShadows_; 115 std::string meshSrc_; //!< This string stores the path where the mesh is stored 116 Mesh mesh_; //!< This is the mesh object linked to this Object, it stores the data from the mesh file in a usable format for the Ogre engine 117 bool bCastShadows_; //!< This value determines whether a Model is casting a shadow or not, turn it off to save performance, when not needed 118 unsigned int renderQueueGroup_; //!< This variable stores which render queue group this object is assigned to 119 std::string materialName_; //!< This string stores the name of the material to be applied to the mesh/model 82 120 83 121 //LoD 84 bool bGlobalEnableLod_; 85 float lodLevel_; 86 bool bLodEnabled_; 87 unsigned int numLodLevels_; 88 float lodReductionRate_; 122 bool bGlobalEnableLod_; //!< Has LoD been turned on in the graphics configuration? 123 float lodLevel_; //!< Standard LoD Level 124 bool bLodEnabled_; //!< Is LoD to be used on this model? 125 unsigned int numLodLevels_; //!< How many LoD does this model feature 126 float lodReductionRate_; //!< How fast should be switched to lower LoDs 89 127 90 128 };
Note: See TracChangeset
for help on using the changeset viewer.