#include <broadphase.h>
Inherited by physics::OctreeBroadPhase, physics::QuadtreeBroadPhase, and physics::SortAndSweep< d >.
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 Body * | findBeneath (const Vector &position) |
virtual Body * | findBeneath (const AARect &rect) |
virtual Body * | intersectRay (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) |
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.
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.
std::list< typename d::Body * > physics::BroadPhase< d >::findBeneathAll | ( | const Vector & | position | ) | [inline, virtual] |
Find all bodies located at this position (if any).
std::list< typename d::Body * > physics::BroadPhase< d >::findBeneathAll | ( | const AARect & | rect | ) | [inline, virtual] |
Find all bodies touching this rect.
d::Body * physics::BroadPhase< d >::findBeneath | ( | const Vector & | position | ) | [inline, virtual] |
Find the first body located at this position (if any).
d::Body * physics::BroadPhase< d >::findBeneath | ( | const AARect & | rect | ) | [inline, virtual] |
Find the first body touching this rect
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
start | Origin of the ray. | |
dir | Direction of the ray. | |
p | Set by reference to the intersection point found. |
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.
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.
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.
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.
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.
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.