/**
* Interface for game objects that can be drawn to the screen and have a
- * specified size.
+ * specified volume (take up space).
*/
class Entity : public Cullable, public Drawable
{
+protected:
+
+ Aabb mAabb;
+ Sphere mSphere;
+
public:
+
virtual ~Entity() {}
virtual void drawIfVisible(Scalar alpha, const Frustum& frustum) const
{
if (isVisible(frustum)) draw(alpha);
}
+
+ virtual bool isVisible(const Frustum& frustum) const
+ {
+ return mSphere.isVisible(frustum) && mAabb.isVisible(frustum);
+ }
+
+ const Aabb& getAabb() const
+ {
+ return mAabb;
+ }
+
+ const Sphere& getSphere() const
+ {
+ return mSphere;
+ }
};