physics::BroadPhase< d > Class Template Reference

#include <broadphase.h>

Inherited by physics::OctreeBroadPhase, physics::QuadtreeBroadPhase, and physics::SortAndSweep< d >.

List of all members.

Public Member Functions

virtual void init (World *world)
virtual output_container findPairs ()
virtual std::list< Body * > findBeneathAll (const Vector &position)
virtual std::list< Body * > findBeneathAll (const AARect &rect)
virtual BodyfindBeneath (const Vector &position)
virtual BodyfindBeneath (const AARect &rect)
virtual BodyintersectRay (const Vector &start, const Vector &dir, Vector &p)
virtual void bodyAdded (Body *body)
virtual void bodyRemoved (Body *body)

Static Public Member Functions

static bool test (const Body *a, const Body *b)
static bool ignore (const Body *a, const Body *b)
static bool testRadius (const Body *a, const Body *b, const float _near=Globals::_NEAR)
static bool testAABB (const Body *a, const Body *b, const float _near=Globals::_NEAR)


Detailed Description

template<typename d>
class physics::BroadPhase< d >

Broad phase collision detection: detects pairs of bodies which are potentially colliding. Default naive implementation checks all pairs with n^2 performance.

Member Function Documentation

template<typename d>
virtual void physics::BroadPhase< d >::init ( World world  )  [inline, virtual]

Attach this BroadPhase object to a World. Subclasses that override this method should call this from their implementation.

Reimplemented in physics::OctreeBroadPhase, and physics::QuadtreeBroadPhase.

template<typename d>
physics::BroadPhase< d >::output_container physics::BroadPhase< d >::findPairs (  )  [inline, virtual]

Find all pairs of bodies that might be colliding.

Reimplemented in physics::OctreeBroadPhase, and physics::QuadtreeBroadPhase.

template<typename d>
std::list< typename d::Body * > physics::BroadPhase< d >::findBeneathAll ( const Vector &  position  )  [inline, virtual]

Find all bodies located at this position (if any).

template<typename d>
std::list< typename d::Body * > physics::BroadPhase< d >::findBeneathAll ( const AARect &  rect  )  [inline, virtual]

Find all bodies touching this rect.

template<typename d>
d::Body * physics::BroadPhase< d >::findBeneath ( const Vector &  position  )  [inline, virtual]

Find the first body located at this position (if any).

template<typename d>
d::Body * physics::BroadPhase< d >::findBeneath ( const AARect &  rect  )  [inline, virtual]

Find the first body touching this rect

template<typename d>
d::Body * physics::BroadPhase< d >::intersectRay ( const Vector &  start,
const Vector &  dir,
Vector &  p 
) [inline, virtual]

Intersect a ray with the world and return the first Body it hits

Parameters:
start Origin of the ray.
dir Direction of the ray.
p Set by reference to the intersection point found.

template<typename d>
virtual void physics::BroadPhase< d >::bodyAdded ( Body body  )  [inline, virtual]

Notification that a body has been added to the world. Default implementation does nothing.

Reimplemented in physics::OctreeBroadPhase, and physics::QuadtreeBroadPhase.

template<typename d>
virtual void physics::BroadPhase< d >::bodyRemoved ( Body body  )  [inline, virtual]

Notification that a body has been removed from the world. Default implementation does nothing.

Reimplemented in physics::OctreeBroadPhase, and physics::QuadtreeBroadPhase.

template<typename d>
static bool physics::BroadPhase< d >::test ( const Body a,
const Body b 
) [inline, static]

Convenience method for implementation classes. Returns true if we need to consider these two bodies for contact generation and they are potentially colliding.

template<typename d>
static bool physics::BroadPhase< d >::ignore ( const Body a,
const Body b 
) [inline, static]

Convenience method for implementation classes. Returns true if we don't need to consider these two bodies for contact generation.

template<typename d>
static bool physics::BroadPhase< d >::testRadius ( const Body a,
const Body b,
const float  _near = Globals::_NEAR 
) [inline, static]

Convenience method for implementation classes. Returns true if the bounding radii for these bodies are overlapping.

template<typename d>
static bool physics::BroadPhase< d >::testAABB ( const Body a,
const Body b,
const float  _near = Globals::_NEAR 
) [inline, static]

Convenience method for implementation classes. Returns true if the axis-aligned bounding boxes for these bodies are overlapping.


The documentation for this class was generated from the following files:

Generated on Thu Apr 23 22:51:40 2009 for Large Polygon Collider - Modular 2D/3D Physics Engine by  doxygen 1.5.6