#ifndef GEOMETRY_H #define GEOMETRY_H #include "common.h" #include "AxisAlignedBox3.h" #include "Triangle3.h" namespace CHCDemo { class RenderState; /** Represents drawable geometry consisting of triangles */ class Geometry { public: /** Constructor taking an array of triangles. */ Geometry(Vector3 *vertices, Vector3 *normals, float *texcoords, int numVertices); /** Render the geometry */ void Render(RenderState *state); int GetNumTriangles() const { return mNumVertices / 3; } inline bool HasTexture() const { return mTexCoords != NULL; } const AxisAlignedBox3& GetBoundingBox() const; protected: void CalcBoundingBox(); /** Prepare vbos for rendering */ void Prepare(); ////////// unsigned int mVboId; Vector3 *mVertices; Vector3 *mNormals; float *mTexCoords; int mNumVertices; AxisAlignedBox3 mBoundingBox; }; } #endif // GEOMETRY_H