X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fentity.hh;h=c86dc9a022aed1d5b2c86dc84a47ff8196262dfa;hp=b503551b38f2422fa4b9f6597c79314f1d91a0c0;hb=44b3014bce798789e795242d1556cb7449e6386a;hpb=831f04d4bc19a390415ac0bbac4331c7a65509bc diff --git a/src/moof/entity.hh b/src/moof/entity.hh index b503551..c86dc9a 100644 --- a/src/moof/entity.hh +++ b/src/moof/entity.hh @@ -1,22 +1,15 @@ -/*] Copyright (c) 2009-2010, Charles McGarvey [************************** +/*] Copyright (c) 2009-2011, Charles McGarvey [***************************** **] All rights reserved. * -* vi:ts=4 sw=4 tw=75 -* * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * -**************************************************************************/ +*****************************************************************************/ #ifndef _MOOF_ENTITY_HH_ #define _MOOF_ENTITY_HH_ -/** - * \file entity.hh - * Interface class for cullable and drawable objects. - */ - #include #include @@ -25,20 +18,17 @@ #include +/** + * \file entity.hh + * Interface class for cullable and drawable objects. + */ + namespace moof { +// forward declarations class frustum; - -class entity; - -/** - * Entity pointer. - */ -typedef boost::shared_ptr entity_ptr; - - /** * Interface for game objects that can be drawn to the screen and have a * specified volume (take up space). @@ -57,7 +47,8 @@ public: * timestep. * \param frustum The camera frustum for determining visibility. */ - virtual void draw_if_visible(scalar alpha, const frustum& frustum) const + virtual void + draw_if_visible(scalar alpha, const frustum& frustum) const { if (is_visible(frustum)) draw(alpha); } @@ -74,12 +65,11 @@ public: return sphere_.is_visible(frustum) && aabb_.is_visible(frustum); } - /** * Get the axis-aligned bounding box surrounding the entity. * \return The AABB. */ - const moof::aabb<3>& aabb() const + const moof::aabb3& aabb() const { return aabb_; } @@ -87,18 +77,19 @@ public: /** Get the bounding sphere surrounding the entity. * \return The sphere. */ - const moof::sphere<3>& sphere() const + const moof::sphere3& sphere() const { return sphere_; } - protected: - moof::aabb<3> aabb_; - moof::sphere<3> sphere_; + moof::aabb3 aabb_; + moof::sphere3 sphere_; }; +typedef boost::shared_ptr entity_ptr; + } // namespace moof