Ignore:
Timestamp:
01/04/09 16:06:56 (15 years ago)
Author:
mattausch
Message:

pvs seems to work now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.h

    r3243 r3245  
    2424{ 
    2525        friend class RenderQueue; 
    26         friend class EntityMerger; 
    2726 
    2827public: 
     
    3130        */ 
    3231        SceneEntity(Transform3 *trafo); 
    33         /** Copy constructur. 
    34         */ 
    35         //SceneEntity(const SceneEntity &e); 
    3632        /** Destructor. 
    3733        */ 
     
    4541        /** See set 
    4642        */ 
    47         inline Shape *GetShape(int i) const { return mShapes[i]; } 
     43        inline Shape *GetShape(int i) const; 
    4844        /** Returns number of shapes in vector. 
    4945        */ 
    50         inline int GetNumShapes() { return (int)mShapes.size(); } 
     46        inline int GetNumShapes(); 
    5147        /** Set pointer to the geometry 
    5248        */ 
     
    5450        /** set frame where we last rendered this node 
    5551        */ 
    56         void SetLastRendered(int lastRendered); 
     52        void SetLastRenderedFrame(int lastRendered); 
    5753        /** returns frame where we last visited this node 
    5854        */ 
    59         int GetLastRendered() const; 
     55        int GetLastRenderedFrame() const; 
    6056        /** Returns the trafo of this scene entity. 
    6157        */ 
    62         inline Transform3 *GetTransform() const  { return mTransform; } 
     58        inline Transform3 *GetTransform() const; 
    6359        /** Counts number of triangles in this entity using the specified lod level 
    6460                with 0 being the highest or the current lod level (if the argument is -1). 
     
    7167        */ 
    7268        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; 
    7478 
    7579 
     
    8589        /** Adds a new lod level. 
    8690        */ 
    87         void AddLODLevel(const LODLevel &lod) { mLODLevels.push_back(lod); } 
     91        void AddLODLevel(const LODLevel &lod); 
    8892        /** Returns numbers of lod levels. 
    8993        */ 
    90         int GetNumLODLevels() const { return (int)mLODLevels.size(); } 
     94        int GetNumLODLevels() const; 
    9195        /** Returns center point of this shape. 
    9296        */ 
    93         Vector3 GetCenter() const {return mCenter; } 
     97        Vector3 GetCenter() const; 
    9498        /** Returns transformed center point of this shape. 
    9599        */ 
     
    107111        /** If false, the highest (most detailed) LOD level is used for all entities. 
    108112        */ 
    109         static void SetUseLODs(bool useLODs) { sUseLODs = useLODs; } 
     113        static void SetUseLODs(bool useLODs); 
    110114        /** See set 
    111115        */ 
    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); 
    113121 
    114122protected: 
     
    133141        ShapeContainer mShapes; 
    134142        /// when this entity was last rendered 
    135         int mLastRendered; 
     143        int mLastRenderedFrame; 
    136144        /// the LOD level currently used for rendering 
    137145        int mCurrentLODLevel; 
     
    145153        static bool sUseLODs; 
    146154        static int sCurrentId; 
     155 
     156        int mVisibleId; 
     157        static int sVisibleId; 
    147158}; 
    148159 
    149160 
     161inline void SceneEntity::AddLODLevel(const LODLevel &lod) 
     162{  
     163        mLODLevels.push_back(lod);  
     164} 
     165 
     166 
     167inline int SceneEntity::GetNumLODLevels() const  
     168{ 
     169        return (int)mLODLevels.size();  
     170} 
     171 
     172 
     173inline Vector3 SceneEntity::GetCenter() const  
     174{  
     175        return mCenter;  
     176} 
     177 
     178 
     179inline void SceneEntity::SetUseLODs(bool useLODs)  
     180{ 
     181        sUseLODs = useLODs;  
     182} 
     183 
     184 
     185inline bool SceneEntity::GetUseLODs()  
     186{  
     187        return sUseLODs;  
     188} 
     189 
     190 
     191inline Shape *SceneEntity::GetShape(int i) const  
     192{  
     193        return mShapes[i];  
     194} 
     195 
     196 
     197inline int SceneEntity::GetNumShapes() 
     198{ 
     199        return (int)mShapes.size();  
     200} 
     201 
     202 
     203inline Transform3 *SceneEntity::GetTransform() const   
     204{  
     205        return mTransform;  
     206} 
     207 
     208 
     209inline void SceneEntity::SetVisibleId(int id) 
     210{ 
     211        mVisibleId = id; 
     212} 
     213 
     214 
     215inline void SceneEntity::SetGlobalVisibleId(int id) 
     216{ 
     217        sVisibleId = id; 
     218} 
     219 
     220 
     221inline int SceneEntity::GetVisibleId(int id) const 
     222{ 
     223        return mVisibleId; 
     224} 
     225 
     226 
     227inline bool SceneEntity::IsVisible() const 
     228{ 
     229        return (sVisibleId == -1) || (mVisibleId == sVisibleId); 
     230} 
     231 
     232 
    150233} 
    151234 
Note: See TracChangeset for help on using the changeset viewer.