- Timestamp:
- 01/04/09 16:06:56 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.h
r3243 r3245 24 24 { 25 25 friend class RenderQueue; 26 friend class EntityMerger;27 26 28 27 public: … … 31 30 */ 32 31 SceneEntity(Transform3 *trafo); 33 /** Copy constructur.34 */35 //SceneEntity(const SceneEntity &e);36 32 /** Destructor. 37 33 */ … … 45 41 /** See set 46 42 */ 47 inline Shape *GetShape(int i) const { return mShapes[i]; }43 inline Shape *GetShape(int i) const; 48 44 /** Returns number of shapes in vector. 49 45 */ 50 inline int GetNumShapes() { return (int)mShapes.size(); }46 inline int GetNumShapes(); 51 47 /** Set pointer to the geometry 52 48 */ … … 54 50 /** set frame where we last rendered this node 55 51 */ 56 void SetLastRendered (int lastRendered);52 void SetLastRenderedFrame(int lastRendered); 57 53 /** returns frame where we last visited this node 58 54 */ 59 int GetLastRendered () const;55 int GetLastRenderedFrame() const; 60 56 /** Returns the trafo of this scene entity. 61 57 */ 62 inline Transform3 *GetTransform() const { return mTransform; }58 inline Transform3 *GetTransform() const; 63 59 /** Counts number of triangles in this entity using the specified lod level 64 60 with 0 being the highest or the current lod level (if the argument is -1). … … 71 67 */ 72 68 AxisAlignedBox3 GetWorldBoundingBox() const; 73 69 /** Only the scene entities are visible that match the global id. 70 */ 71 void SetVisibleId(int id); 72 /** See set 73 */ 74 int GetVisibleId(int id) const; 75 /** Returns true if this entity is visible. 76 */ 77 bool IsVisible() const; 74 78 75 79 … … 85 89 /** Adds a new lod level. 86 90 */ 87 void AddLODLevel(const LODLevel &lod) { mLODLevels.push_back(lod); }91 void AddLODLevel(const LODLevel &lod); 88 92 /** Returns numbers of lod levels. 89 93 */ 90 int GetNumLODLevels() const { return (int)mLODLevels.size(); }94 int GetNumLODLevels() const; 91 95 /** Returns center point of this shape. 92 96 */ 93 Vector3 GetCenter() const {return mCenter; }97 Vector3 GetCenter() const; 94 98 /** Returns transformed center point of this shape. 95 99 */ … … 107 111 /** If false, the highest (most detailed) LOD level is used for all entities. 108 112 */ 109 static void SetUseLODs(bool useLODs) { sUseLODs = useLODs; }113 static void SetUseLODs(bool useLODs); 110 114 /** See set 111 115 */ 112 static bool GetUseLODs() { return sUseLODs; } 116 static bool GetUseLODs(); 117 /** Sets the global visible id. Scene entities are visible only if 118 this id is -1 or their id matches this id. 119 */ 120 static void SetGlobalVisibleId(int id); 113 121 114 122 protected: … … 133 141 ShapeContainer mShapes; 134 142 /// when this entity was last rendered 135 int mLastRendered ;143 int mLastRenderedFrame; 136 144 /// the LOD level currently used for rendering 137 145 int mCurrentLODLevel; … … 145 153 static bool sUseLODs; 146 154 static int sCurrentId; 155 156 int mVisibleId; 157 static int sVisibleId; 147 158 }; 148 159 149 160 161 inline void SceneEntity::AddLODLevel(const LODLevel &lod) 162 { 163 mLODLevels.push_back(lod); 164 } 165 166 167 inline int SceneEntity::GetNumLODLevels() const 168 { 169 return (int)mLODLevels.size(); 170 } 171 172 173 inline Vector3 SceneEntity::GetCenter() const 174 { 175 return mCenter; 176 } 177 178 179 inline void SceneEntity::SetUseLODs(bool useLODs) 180 { 181 sUseLODs = useLODs; 182 } 183 184 185 inline bool SceneEntity::GetUseLODs() 186 { 187 return sUseLODs; 188 } 189 190 191 inline Shape *SceneEntity::GetShape(int i) const 192 { 193 return mShapes[i]; 194 } 195 196 197 inline int SceneEntity::GetNumShapes() 198 { 199 return (int)mShapes.size(); 200 } 201 202 203 inline Transform3 *SceneEntity::GetTransform() const 204 { 205 return mTransform; 206 } 207 208 209 inline void SceneEntity::SetVisibleId(int id) 210 { 211 mVisibleId = id; 212 } 213 214 215 inline void SceneEntity::SetGlobalVisibleId(int id) 216 { 217 sVisibleId = id; 218 } 219 220 221 inline int SceneEntity::GetVisibleId(int id) const 222 { 223 return mVisibleId; 224 } 225 226 227 inline bool SceneEntity::IsVisible() const 228 { 229 return (sVisibleId == -1) || (mVisibleId == sVisibleId); 230 } 231 232 150 233 } 151 234
Note: See TracChangeset
for help on using the changeset viewer.