Blender V2.61 - r43446
|
#include <btDbvtBroadphase.h>
Public Types | |
enum | { DYNAMIC_SET = 0, FIXED_SET = 1, STAGECOUNT = 2 } |
Public Member Functions | |
btDbvtBroadphase (btOverlappingPairCache *paircache=0) | |
~btDbvtBroadphase () | |
void | collide (btDispatcher *dispatcher) |
void | optimize () |
btBroadphaseProxy * | createProxy (const btVector3 &aabbMin, const btVector3 &aabbMax, int shapeType, void *userPtr, short int collisionFilterGroup, short int collisionFilterMask, btDispatcher *dispatcher, void *multiSapProxy) |
virtual void | destroyProxy (btBroadphaseProxy *proxy, btDispatcher *dispatcher) |
virtual void | setAabb (btBroadphaseProxy *proxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher) |
virtual void | rayTest (const btVector3 &rayFrom, const btVector3 &rayTo, btBroadphaseRayCallback &rayCallback, const btVector3 &aabbMin=btVector3(0, 0, 0), const btVector3 &aabbMax=btVector3(0, 0, 0)) |
virtual void | aabbTest (const btVector3 &aabbMin, const btVector3 &aabbMax, btBroadphaseAabbCallback &callback) |
virtual void | getAabb (btBroadphaseProxy *proxy, btVector3 &aabbMin, btVector3 &aabbMax) const |
virtual void | calculateOverlappingPairs (btDispatcher *dispatcher) |
calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb | |
virtual btOverlappingPairCache * | getOverlappingPairCache () |
virtual const btOverlappingPairCache * | getOverlappingPairCache () const |
virtual void | getBroadphaseAabb (btVector3 &aabbMin, btVector3 &aabbMax) const |
virtual void | printStats () |
virtual void | resetPool (btDispatcher *dispatcher) |
reset broadphase internal structures, to ensure determinism/reproducability | |
void | performDeferredRemoval (btDispatcher *dispatcher) |
void | setVelocityPrediction (btScalar prediction) |
btScalar | getVelocityPrediction () const |
void | setAabbForceUpdate (btBroadphaseProxy *absproxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *) |
Static Public Member Functions | |
static void | benchmark (btBroadphaseInterface *) |
Public Attributes | |
btDbvt | m_sets [2] |
btDbvtProxy * | m_stageRoots [STAGECOUNT+1] |
btOverlappingPairCache * | m_paircache |
btScalar | m_prediction |
int | m_stageCurrent |
int | m_fupdates |
int | m_dupdates |
int | m_cupdates |
int | m_newpairs |
int | m_fixedleft |
unsigned | m_updates_call |
unsigned | m_updates_done |
btScalar | m_updates_ratio |
int | m_pid |
int | m_cid |
int | m_gid |
bool | m_releasepaircache |
bool | m_deferedcollide |
bool | m_needcleanup |
The btDbvtBroadphase implements a broadphase using two dynamic AABB bounding volume hierarchies/trees (see btDbvt). One tree is used for static/non-moving objects, and another tree is used for dynamic objects. Objects can move from one tree to the other. This is a very fast broadphase, especially for very dynamic worlds where many objects are moving. Its insert/add and remove of objects is generally faster than the sweep and prune broadphases btAxisSweep3 and bt32BitAxisSweep3.
Definition at line 62 of file btDbvtBroadphase.h.
anonymous enum |
Definition at line 65 of file btDbvtBroadphase.h.
btDbvtBroadphase::btDbvtBroadphase | ( | btOverlappingPairCache * | paircache = 0 | ) |
Definition at line 122 of file btDbvtBroadphase.cpp.
References btAlignedAlloc, clear(), i, m_cid, m_cupdates, m_deferedcollide, m_dupdates, m_fixedleft, m_fupdates, m_gid, m_needcleanup, m_newpairs, m_paircache, m_pid, m_prediction, m_releasepaircache, m_stageCurrent, m_stageRoots, m_updates_call, m_updates_done, m_updates_ratio, and STAGECOUNT.
btDbvtBroadphase::~btDbvtBroadphase | ( | ) |
Definition at line 151 of file btDbvtBroadphase.cpp.
References btAlignedFree, m_paircache, m_releasepaircache, and btOverlappingPairCache::~btOverlappingPairCache().
void btDbvtBroadphase::aabbTest | ( | const btVector3 & | aabbMin, |
const btVector3 & | aabbMax, | ||
btBroadphaseAabbCallback & | callback | ||
) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 268 of file btDbvtBroadphase.cpp.
References ATTRIBUTE_ALIGNED16, bounds(), btDbvt::collideTV(), btDbvtAabbMm::FromMM(), iTaSC::m_root, and m_sets.
void btDbvtBroadphase::benchmark | ( | btBroadphaseInterface * | ) | [static] |
Definition at line 789 of file btDbvtBroadphase.cpp.
void btDbvtBroadphase::calculateOverlappingPairs | ( | btDispatcher * | dispatcher | ) | [virtual] |
calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
Implements btBroadphaseInterface.
Definition at line 390 of file btDbvtBroadphase.cpp.
References clear(), collide(), btOverlappingPairCache::getNumOverlappingPairs(), btDbvt::m_leaves, m_paircache, m_pid, m_sets, performDeferredRemoval(), and sum().
void btDbvtBroadphase::collide | ( | btDispatcher * | dispatcher | ) |
Definition at line 490 of file btDbvtBroadphase.cpp.
References ATTRIBUTE_ALIGNED16, btMin(), btSwap(), btDbvt::collideTTpersistentStack(), btDbvt::collideTV(), btDbvtAabbMm::FromMM(), btOverlappingPairCache::getOverlappingPairArray(), i, btDbvt::insert(), Intersect(), btDbvtProxy::leaf, btDbvtProxy::links, listappend(), listremove(), m_cid, m_cupdates, m_deferedcollide, m_dupdates, m_fixedleft, m_fupdates, btDbvt::m_leaves, m_needcleanup, m_newpairs, m_paircache, m_pid, iTaSC::m_root, m_sets, m_stageCurrent, m_stageRoots, m_updates_call, m_updates_done, m_updates_ratio, next, btDbvt::optimizeIncremental(), p, btDbvtTreeCollider::proxy, btDbvt::remove(), btOverlappingPairCallback::removeOverlappingPair(), btOverlappingPairCallback::removeOverlappingPairsContainingProxy(), btAlignedObjectArray< T >::size(), SPC, btDbvtProxy::stage, STAGECOUNT, and btDbvtNode::volume.
Referenced by calculateOverlappingPairs().
btBroadphaseProxy * btDbvtBroadphase::createProxy | ( | const btVector3 & | aabbMin, |
const btVector3 & | aabbMax, | ||
int | shapeType, | ||
void * | userPtr, | ||
short int | collisionFilterGroup, | ||
short int | collisionFilterMask, | ||
btDispatcher * | dispatcher, | ||
void * | multiSapProxy | ||
) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 161 of file btDbvtBroadphase.cpp.
References btAlignedAlloc, btDbvt::collideTV(), btDbvtAabbMm::FromMM(), btDbvt::insert(), btDbvtProxy::leaf, listappend(), m_deferedcollide, m_gid, iTaSC::m_root, m_sets, m_stageCurrent, m_stageRoots, btDbvtTreeCollider::proxy, and btDbvtProxy::stage.
Referenced by CcdPhysicsEnvironment::addCcdGraphicController().
void btDbvtBroadphase::destroyProxy | ( | btBroadphaseProxy * | proxy, |
btDispatcher * | dispatcher | ||
) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 192 of file btDbvtBroadphase.cpp.
References btAlignedFree, btDbvtProxy::leaf, listremove(), m_needcleanup, m_paircache, m_sets, m_stageRoots, btDbvt::remove(), btOverlappingPairCallback::removeOverlappingPairsContainingProxy(), btDbvtProxy::stage, and STAGECOUNT.
Referenced by CcdPhysicsEnvironment::removeCcdGraphicController().
void btDbvtBroadphase::getAabb | ( | btBroadphaseProxy * | proxy, |
btVector3 & | aabbMin, | ||
btVector3 & | aabbMax | ||
) | const [virtual] |
Implements btBroadphaseInterface.
Definition at line 206 of file btDbvtBroadphase.cpp.
void btDbvtBroadphase::getBroadphaseAabb | ( | btVector3 & | aabbMin, |
btVector3 & | aabbMax | ||
) | const [virtual] |
getAabb returns the axis aligned bounding box in the 'global' coordinate frame will add some transform later
Implements btBroadphaseInterface.
Definition at line 615 of file btDbvtBroadphase.cpp.
References ATTRIBUTE_ALIGNED16, bounds(), credits_svn_gen::empty, btDbvtAabbMm::FromCR(), btDbvt::m_root, iTaSC::m_root, m_sets, btDbvtAabbMm::Maxs(), Merge(), btDbvtAabbMm::Mins(), and btDbvtNode::volume.
btOverlappingPairCache * btDbvtBroadphase::getOverlappingPairCache | ( | ) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 603 of file btDbvtBroadphase.cpp.
References m_paircache.
const btOverlappingPairCache * btDbvtBroadphase::getOverlappingPairCache | ( | ) | const [virtual] |
Implements btBroadphaseInterface.
Definition at line 609 of file btDbvtBroadphase.cpp.
References m_paircache.
btScalar btDbvtBroadphase::getVelocityPrediction | ( | ) | const [inline] |
Definition at line 130 of file btDbvtBroadphase.h.
References m_prediction.
void btDbvtBroadphase::optimize | ( | ) |
Definition at line 596 of file btDbvtBroadphase.cpp.
References m_sets, and btDbvt::optimizeTopDown().
void btDbvtBroadphase::performDeferredRemoval | ( | btDispatcher * | dispatcher | ) |
Definition at line 417 of file btDbvtBroadphase.cpp.
References btAssert, btOverlappingPairCache::cleanOverlappingPair(), btOverlappingPairCache::getOverlappingPairArray(), btOverlappingPairCache::hasDeferredRemoval(), i, Intersect(), btDbvtProxy::leaf, m_paircache, btAlignedObjectArray< T >::quickSort(), btAlignedObjectArray< T >::resize(), btAlignedObjectArray< T >::size(), and btDbvtNode::volume.
Referenced by calculateOverlappingPairs().
void btDbvtBroadphase::printStats | ( | ) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 665 of file btDbvtBroadphase.cpp.
void btDbvtBroadphase::rayTest | ( | const btVector3 & | rayFrom, |
const btVector3 & | rayTo, | ||
btBroadphaseRayCallback & | rayCallback, | ||
const btVector3 & | aabbMin = btVector3(0,0,0) , |
||
const btVector3 & | aabbMax = btVector3(0,0,0) |
||
) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 227 of file btDbvtBroadphase.cpp.
References btBroadphaseRayCallback::m_lambda_max, btBroadphaseRayCallback::m_rayDirectionInverse, iTaSC::m_root, m_sets, btBroadphaseRayCallback::m_signs, and btDbvt::rayTestInternal().
void btDbvtBroadphase::resetPool | ( | btDispatcher * | dispatcher | ) | [virtual] |
reset broadphase internal structures, to ensure determinism/reproducability
Reimplemented from btBroadphaseInterface.
Definition at line 632 of file btDbvtBroadphase.cpp.
References btDbvt::clear(), i, m_cid, m_cupdates, m_deferedcollide, m_dupdates, m_fixedleft, m_fupdates, m_gid, btDbvt::m_leaves, m_needcleanup, m_newpairs, m_pid, m_sets, m_stageCurrent, m_stageRoots, m_updates_call, m_updates_done, m_updates_ratio, and STAGECOUNT.
void btDbvtBroadphase::setAabb | ( | btBroadphaseProxy * | proxy, |
const btVector3 & | aabbMin, | ||
const btVector3 & | aabbMax, | ||
btDispatcher * | dispatcher | ||
) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 282 of file btDbvtBroadphase.cpp.
References ATTRIBUTE_ALIGNED16, btDbvt::collideTTpersistentStack(), DBVT_BP_MARGIN, btDbvtAabbMm::FromMM(), btDbvt::insert(), Intersect(), btDbvtProxy::leaf, listappend(), listremove(), m_deferedcollide, m_needcleanup, m_prediction, iTaSC::m_root, m_sets, m_stageCurrent, m_stageRoots, m_updates_call, m_updates_done, NotEqual(), btDbvt::remove(), btDbvtProxy::stage, STAGECOUNT, update(), btDbvt::update(), and btDbvtNode::volume.
Referenced by CcdGraphicController::SetGraphicTransform().
void btDbvtBroadphase::setAabbForceUpdate | ( | btBroadphaseProxy * | absproxy, |
const btVector3 & | aabbMin, | ||
const btVector3 & | aabbMax, | ||
btDispatcher * | |||
) |
this setAabbForceUpdate is similar to setAabb but always forces the aabb update. it is not part of the btBroadphaseInterface but specific to btDbvtBroadphase. it bypasses certain optimizations that prevent aabb updates (when the aabb shrinks), see http://code.google.com/p/bullet/issues/detail?id=223
Definition at line 350 of file btDbvtBroadphase.cpp.
References ATTRIBUTE_ALIGNED16, btDbvt::collideTTpersistentStack(), btDbvtAabbMm::FromMM(), btDbvt::insert(), btDbvtProxy::leaf, listappend(), listremove(), m_deferedcollide, m_needcleanup, iTaSC::m_root, m_sets, m_stageCurrent, m_stageRoots, m_updates_call, m_updates_done, btDbvt::remove(), btDbvtProxy::stage, STAGECOUNT, and btDbvt::update().
void btDbvtBroadphase::setVelocityPrediction | ( | btScalar | prediction | ) | [inline] |
Definition at line 126 of file btDbvtBroadphase.h.
References m_prediction.
Definition at line 85 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), and resetPool().
Definition at line 78 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), and resetPool().
Definition at line 88 of file btDbvtBroadphase.h.
Referenced by btAxisSweep3Internal< BP_FP_INT_TYPE >::btAxisSweep3Internal(), btDbvtBroadphase(), collide(), createProxy(), resetPool(), setAabb(), and setAabbForceUpdate().
Definition at line 77 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), and resetPool().
Definition at line 80 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), and resetPool().
Definition at line 76 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), and resetPool().
Definition at line 86 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), createProxy(), and resetPool().
Definition at line 89 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), destroyProxy(), resetPool(), setAabb(), and setAabbForceUpdate().
Definition at line 79 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), btDbvtTreeCollider::Process(), and resetPool().
Definition at line 73 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), calculateOverlappingPairs(), collide(), destroyProxy(), getOverlappingPairCache(), performDeferredRemoval(), btDbvtTreeCollider::Process(), and ~btDbvtBroadphase().
Definition at line 84 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), calculateOverlappingPairs(), collide(), and resetPool().
Definition at line 74 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), getVelocityPrediction(), setAabb(), and setVelocityPrediction().
Definition at line 87 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), and ~btDbvtBroadphase().
Definition at line 71 of file btDbvtBroadphase.h.
Referenced by aabbTest(), calculateOverlappingPairs(), collide(), createProxy(), destroyProxy(), getBroadphaseAabb(), optimize(), rayTest(), resetPool(), setAabb(), and setAabbForceUpdate().
Definition at line 75 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), createProxy(), resetPool(), setAabb(), and setAabbForceUpdate().
btDbvtProxy* btDbvtBroadphase::m_stageRoots[STAGECOUNT+1] |
Definition at line 72 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), createProxy(), destroyProxy(), resetPool(), setAabb(), and setAabbForceUpdate().
unsigned btDbvtBroadphase::m_updates_call |
Definition at line 81 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), resetPool(), setAabb(), and setAabbForceUpdate().
unsigned btDbvtBroadphase::m_updates_done |
Definition at line 82 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), resetPool(), setAabb(), and setAabbForceUpdate().
Definition at line 83 of file btDbvtBroadphase.h.
Referenced by btDbvtBroadphase(), collide(), and resetPool().