#ifndef __SHAPE_H #define __SHAPE_H #include "glInterface.h" #include #include #include "common.h" #include "Vector3.h" namespace CHCDemoEngine { class Material; class Geometry; class RenderState; class AxisAlignedBox3; class Vector3; struct RenderQueueBucket; /** Class representing a shape. A shape basically consists of geometry and a material */ class Shape { friend class RenderQueue; public: /** Creates a scene entity. */ Shape(Geometry *geometry, Material *mat, SceneEntity *parent); ~Shape(); /** Renders this node. */ void Render(RenderState *state); /** Set pointer to the geometry */ void SetGeometry(Geometry *geom); /** See set */ Geometry *GetGeometry() const { return mGeometry; } /** Set pointer to the material */ void SetMaterial(Material *mat); /** Returns the transformed bounding box. */ AxisAlignedBox3 GetBoundingBox() const; /** Returns bounding box transformed with the parent transform. */ AxisAlignedBox3 GetTransformedBoundingBox() const; /** Returns material of this shape. */ inline Material *GetMaterial() const { return mMaterial; } /** Returns transformed center point of this shape. */ Vector3 GetCenter() const; protected: Vector3 mCenter; Geometry *mGeometry; Material *mMaterial; SceneEntity *mParent; /// pointer to the renderqueue bucket this entity belongs to RenderQueueBucket *mRenderQueueBucket; }; } #endif // __SCENEENTITY_H