]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Entity.hh
cade lab fixes
[chaz/yoink] / src / Moof / Entity.hh
index dc600103e54e890bcc2e0e5713f69619d3286a25..ee0f8602c6fd8585090251b9d89cab8f753aefd6 100644 (file)
@@ -48,18 +48,39 @@ class Frustum;
 
 /**
  * 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<3>         mAabb;
+       Sphere<3>       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<3>& getAabb() const
+       {
+               return mAabb;
+       }
+
+       const Sphere<3>& getSphere() const
+       {
+               return mSphere;
+       }
 };
 
 
This page took 0.018595 seconds and 4 git commands to generate.