source:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.h
@
2842
Revision 2842, 1.0 KB checked in by mattausch, 16 years ago (diff) |
---|
Rev | Line | |
---|---|---|
[2840] | 1 | #ifndef __GEOMETRY_H |
2 | #define __GEOMETRY_H | |
[2642] | 3 | |
[2752] | 4 | #include "common.h" |
5 | #include "AxisAlignedBox3.h" | |
[2755] | 6 | #include "Triangle3.h" |
[2751] | 7 | |
[2752] | 8 | |
[2776] | 9 | namespace CHCDemoEngine |
[2642] | 10 | { |
11 | ||
[2773] | 12 | class RenderState; |
13 | ||
[2751] | 14 | /** Represents drawable geometry consisting of triangles |
[2642] | 15 | */ |
16 | class Geometry | |
17 | { | |
[2823] | 18 | friend class ResourceManager; |
19 | ||
[2642] | 20 | public: |
[2756] | 21 | /** Constructor taking an array of triangles. |
[2751] | 22 | */ |
[2823] | 23 | Geometry(Vector3 *vertices, |
24 | Vector3 *normals, | |
25 | float *texcoords, | |
26 | int numVertices, | |
27 | bool delData); | |
[2793] | 28 | |
[2781] | 29 | ~Geometry(); |
[2756] | 30 | /** Render the geometry |
31 | */ | |
[2773] | 32 | void Render(RenderState *state); |
[2642] | 33 | |
[2773] | 34 | int GetNumTriangles() const { return mNumVertices / 3; } |
[2755] | 35 | |
[2795] | 36 | inline bool HasTexture() const { return mHasTexture; } |
[2842] | 37 | |
[2756] | 38 | const AxisAlignedBox3& GetBoundingBox() const; |
[2755] | 39 | |
[2751] | 40 | protected: |
[2642] | 41 | |
[2756] | 42 | void CalcBoundingBox(); |
43 | /** Prepare vbos for rendering | |
44 | */ | |
45 | void Prepare(); | |
[2751] | 46 | |
47 | ||
[2756] | 48 | ////////// |
[2755] | 49 | |
[2756] | 50 | Vector3 *mVertices; |
[2755] | 51 | |
[2756] | 52 | Vector3 *mNormals; |
[2746] | 53 | |
[2756] | 54 | float *mTexCoords; |
[2642] | 55 | |
[2793] | 56 | unsigned int mVboId; |
57 | ||
[2756] | 58 | int mNumVertices; |
59 | ||
[2751] | 60 | AxisAlignedBox3 mBoundingBox; |
[2795] | 61 | |
62 | bool mHasTexture; | |
[2642] | 63 | }; |
64 | ||
[2756] | 65 | |
[2751] | 66 | } |
[2752] | 67 | |
[2642] | 68 | #endif // GEOMETRY_H |
Note: See TracBrowser
for help on using the repository browser.