X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEntity.hh;h=52cb79d442f2b4c6db1afe0faf7097468beedbef;hp=dc600103e54e890bcc2e0e5713f69619d3286a25;hb=a31d65a998121df0651c57bfb68782e2a07d2e2f;hpb=a4debfe4a5f5d339410788971b698ba00cb7f09c diff --git a/src/Moof/Entity.hh b/src/Moof/Entity.hh index dc60010..52cb79d 100644 --- a/src/Moof/Entity.hh +++ b/src/Moof/Entity.hh @@ -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 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; + } };