X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEntity.hh;h=310e0a128cbb52c0371ec742390d3d46144fcaeb;hp=7595054e68e8aa534b7c58966c6687cb22f5f487;hb=7e898e8ec0ff716e2fc722b883a626a6c346f107;hpb=493ddb59a8620b49dfa0ff62ce93395ebfd02e86 diff --git a/src/Moof/Entity.hh b/src/Moof/Entity.hh index 7595054..310e0a1 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 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 EntityPtr; - } // namespace Mf