]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Entity.hh
dispatcher alias methods
[chaz/yoink] / src / Moof / Entity.hh
index 7595054e68e8aa534b7c58966c6687cb22f5f487..33efcc9e77ca20afbc362184007306e0ca586c7f 100644 (file)
 #include <Moof/Aabb.hh>
 #include <Moof/Cullable.hh>
 #include <Moof/Drawable.hh>
+#include <Moof/Sphere.hh>
 
 
 namespace Mf {
 
 
+class Entity;
+typedef boost::shared_ptr<Entity> EntityP;
+
+class Camera;
+
+
 /**
- * Interface for game objects that can be drawn to the screen and half a
+ * Interface for game objects that can be drawn to the screen and have a
  * specified size.
  */
 
 class Entity : public Drawable, public Cullable
 {
 public:
+       inline virtual ~Entity() {}
+
        const Aabb& getAabb() const
        {
                return aabb_;
        }
 
+       const Sphere& getSphere() const
+       {
+               return sphere_;
+       }
+
+       virtual void drawIfVisible(Scalar alpha, const Camera& cam) const
+       {
+               if (isVisible(cam)) draw(alpha);
+       }
+
 protected:
-       Aabb aabb_;
+       Aabb    aabb_;
+       Sphere  sphere_;
 };
 
-typedef boost::shared_ptr<Entity> EntityPtr;
-
 
 } // namespace Mf
 
This page took 0.018904 seconds and 4 git commands to generate.