-/*] 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 <boost/shared_ptr.hpp>
#include <moof/aabb.hh>
#include <moof/sphere.hh>
+/**
+ * \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> entity_ptr;
-
-
/**
* Interface for game objects that can be drawn to the screen and have a
* specified volume (take up space).
* 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);
}
return sphere_.is_visible(frustum) && aabb_.is_visible(frustum);
}
-
/**
* Get the axis-aligned bounding box surrounding the entity.
* \return The AABB.
return sphere_;
}
-
protected:
- moof::aabb3 aabb_;
+ moof::aabb3 aabb_;
moof::sphere3 sphere_;
};
+typedef boost::shared_ptr<entity> entity_ptr;
+
} // namespace moof