]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Entity.hh
refactoring the scene class
[chaz/yoink] / src / Moof / Entity.hh
index 738e13785b0f3d77bcb09580ce83288dc1d02ffe..310e0a128cbb52c0371ec742390d3d46144fcaeb 100644 (file)
 #include <boost/shared_ptr.hpp>
 
 #include <Moof/Aabb.hh>
-#include <Moof/Drawable.hh>
 #include <Moof/Cullable.hh>
+#include <Moof/Drawable.hh>
+#include <Moof/Sphere.hh>
 
 
 namespace Mf {
 
 
+class Entity;
+typedef boost::shared_ptr<Entity> EntityP;
+
+class Frustum;
+
+
 /**
- * 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
+class Entity : public Cullable, public Drawable
 {
 public:
+       virtual ~Entity() {}
+
        const Aabb& getAabb() const
        {
                return aabb_;
        }
 
+       const Sphere& getSphere() const
+       {
+               return sphere_;
+       }
+
+       void drawIfVisible(Scalar alpha, const Frustum& frustum) const
+       {
+               if (isVisible(frustum)) draw(alpha);
+       }
+
 protected:
-       Aabb aabb_;
+       Aabb    aabb_;
+       Sphere  sphere_;
 };
 
-typedef boost::shared_ptr<Entity> EntityPtr;
-
 
 } // namespace Mf
 
This page took 0.018516 seconds and 4 git commands to generate.