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

Revision 2823, 1.0 KB checked in by mattausch, 16 years ago (diff)

debug version providing not instanted geometryx

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{
18friend class ResourceManager;
19
20public:
21        /** Constructor taking an array of triangles.
22        */
23        Geometry(Vector3 *vertices,
24                     Vector3 *normals,
25                         float *texcoords,
26                         int numVertices,
27                         bool delData);
28
29        ~Geometry();
30        /** Render the geometry
31        */
32        void Render(RenderState *state);
33
34        int GetNumTriangles() const { return mNumVertices / 3; }
35
36        inline bool HasTexture() const { return mHasTexture; }
37        const AxisAlignedBox3& GetBoundingBox() const;
38
39protected:
40
41        void CalcBoundingBox();
42        /** Prepare vbos for rendering
43        */
44        void Prepare();
45
46
47        //////////
48
49        Vector3 *mVertices;
50
51        Vector3 *mNormals;
52
53        float *mTexCoords;
54
55        unsigned int mVboId;
56
57        int mNumVertices;
58
59        AxisAlignedBox3 mBoundingBox;
60
61        bool mHasTexture;
62};
63
64
65}
66
67#endif // GEOMETRY_H
Note: See TracBrowser for help on using the repository browser.