source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.h @ 2793

Revision 2793, 973 bytes checked in by mattausch, 16 years ago (diff)
Line 
1#ifndef GEOMETRY_H
2#define GEOMETRY_H
3
4#include "common.h"
5#include "AxisAlignedBox3.h"
6#include "Triangle3.h"
7
8
9namespace CHCDemoEngine
10{
11
12class RenderState;
13
14/** Represents drawable geometry consisting of triangles
15*/
16class Geometry
17{
18public:
19        /** Constructor taking an array of triangles.
20        */
21        Geometry(Vector3 *vertices, Vector3 *normals, float *texcoords, int numVertices, bool delData);
22
23        ~Geometry();
24        /** Render the geometry
25        */
26        void Render(RenderState *state);
27
28        int GetNumTriangles() const { return mNumVertices / 3; }
29
30        inline bool HasTexture() const { return mTexCoords != NULL; }
31        const AxisAlignedBox3& GetBoundingBox() const;
32
33protected:
34
35        void CalcBoundingBox();
36        /** Prepare vbos for rendering
37        */
38        void Prepare();
39
40
41        //////////
42
43        Vector3 *mVertices;
44
45        Vector3 *mNormals;
46
47        float *mTexCoords;
48
49        unsigned int mVboId;
50
51        int mNumVertices;
52
53        AxisAlignedBox3 mBoundingBox;
54};
55
56
57}
58
59#endif // GEOMETRY_H
Note: See TracBrowser for help on using the repository browser.