X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEntity.hh;h=33efcc9e77ca20afbc362184007306e0ca586c7f;hp=7595054e68e8aa534b7c58966c6687cb22f5f487;hb=f72400af4fa3e7b54dab154b5a2b6503a6f9af18;hpb=493ddb59a8620b49dfa0ff62ce93395ebfd02e86 diff --git a/src/Moof/Entity.hh b/src/Moof/Entity.hh index 7595054..33efcc9 100644 --- a/src/Moof/Entity.hh +++ b/src/Moof/Entity.hh @@ -34,30 +34,48 @@ #include #include #include +#include namespace Mf { +class Entity; +typedef boost::shared_ptr 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 EntityPtr; - } // namespace Mf