X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEntity.hh;h=f593d0cd316d872468e44b11b290750c4ffcc8fe;hp=738e13785b0f3d77bcb09580ce83288dc1d02ffe;hb=72d4af22710317acffab861421c4364b1780b6fe;hpb=29e3d45f7bbbf31eadf793c41ff2b3d9c47b7539 diff --git a/src/Moof/Entity.hh b/src/Moof/Entity.hh index 738e137..f593d0c 100644 --- a/src/Moof/Entity.hh +++ b/src/Moof/Entity.hh @@ -32,28 +32,44 @@ #include #include -#include #include +#include +#include namespace Mf { +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;