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