#ifndef __SHAPE_H #define __SHAPE_H #include "common.h" #include "Vector3.h" namespace CHCDemoEngine { class Material; class Geometry; class RenderState; class AxisAlignedBox3; class Vector3; struct RenderQueueBucket; /** Class representing a 3D shape consisting of geometry (with texture coordinates, normals) and a material */ class Shape { friend class RenderQueue; public: /** Creates a scene entity. */ Shape(Geometry *geometry, Material *mat); ~Shape(); /** Renders this node. */ void Render(RenderState *state, SceneEntity *ent = NULL); /** Set pointer to the geometry */ void SetGeometry(Geometry *geom); /** See set */ inline Geometry *GetGeometry() const { return mGeometry; } /** Set pointer to the material */ void SetMaterial(Material *mat); /** Returns the transformed bounding box. */ AxisAlignedBox3 GetBoundingBox() const; /** Returns material of this shape. */ inline Material *GetMaterial() const { return mMaterial; } /** Returns center point of this shape. */ Vector3 GetCenter() const; protected: Vector3 mCenter; Geometry *mGeometry; Material *mMaterial; }; } #endif // __SCENEENTITY_H