source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/LODInfo.h @ 2853

Revision 2853, 1.2 KB checked in by mattausch, 16 years ago (diff)
Line 
1#ifndef __LODINFO_H
2#define __LODINFO_H
3
4#include "common.h"
5#include "Vector3.h"
6
7
8namespace CHCDemoEngine
9{
10
11/** Class representing information about an LOD level.
12        The distance parameter indicates the distance where this
13        lod level is invoked - if the parameter value is smaller or equal
14        than the distance to the view point.
15*/
16struct LODLevel
17{
18        //friend class SceneEntity;
19
20public:
21       
22        LODLevel(float squaredDist): mSquaredDistance(squaredDist) {}
23
24        inline float GetSquaredDistance() { return mSquaredDistance; }
25
26        inline int GetNumShapes() { return (int)mShapes.size(); }
27       
28        inline int GetNumTriangles() { return mNumTriangles; }
29
30        inline Shape *GetShape(size_t i) { return mShapes[i]; }
31
32        inline ShapeContainer &GetShapes() { return mShapes; }
33
34        void AddShape(Shape *shape);
35
36
37        ////////////////
38
39        /** Has to be called each frame in order to use proper LOD level.
40        */
41        static void InitFrame(const Vector3 &viewPoint);
42
43
44        static int sFrameId;
45        static Vector3 sViewPoint;
46
47
48
49protected:
50
51        /////////////////////
52
53        float mNumTriangles;
54
55        /// distance of this LOD level
56        float mSquaredDistance;
57        /// shapes belonging to this LOD level
58        ShapeContainer mShapes;
59};
60
61}
62
63#endif // __LODINFO_H
Note: See TracBrowser for help on using the repository browser.