Blender V2.61 - r43446
|
#include <btSimpleBroadphase.h>
Public Member Functions | |
btSimpleBroadphase (int maxProxies=16384, btOverlappingPairCache *overlappingPairCache=0) | |
virtual | ~btSimpleBroadphase () |
virtual btBroadphaseProxy * | createProxy (const btVector3 &aabbMin, const btVector3 &aabbMax, int shapeType, void *userPtr, short int collisionFilterGroup, short int collisionFilterMask, btDispatcher *dispatcher, void *multiSapProxy) |
virtual void | calculateOverlappingPairs (btDispatcher *dispatcher) |
calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb | |
virtual void | destroyProxy (btBroadphaseProxy *proxy, btDispatcher *dispatcher) |
virtual void | setAabb (btBroadphaseProxy *proxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher) |
virtual void | getAabb (btBroadphaseProxy *proxy, btVector3 &aabbMin, btVector3 &aabbMax) const |
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) |
btOverlappingPairCache * | getOverlappingPairCache () |
const btOverlappingPairCache * | getOverlappingPairCache () const |
bool | testAabbOverlap (btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) |
virtual void | getBroadphaseAabb (btVector3 &aabbMin, btVector3 &aabbMax) const |
virtual void | printStats () |
Static Public Member Functions | |
static bool | aabbOverlap (btSimpleBroadphaseProxy *proxy0, btSimpleBroadphaseProxy *proxy1) |
Protected Member Functions | |
int | allocHandle () |
void | freeHandle (btSimpleBroadphaseProxy *proxy) |
btSimpleBroadphaseProxy * | getSimpleProxyFromProxy (btBroadphaseProxy *proxy) |
const btSimpleBroadphaseProxy * | getSimpleProxyFromProxy (btBroadphaseProxy *proxy) const |
virtual void | resetPool (btDispatcher *dispatcher) |
reset broadphase internal structures, to ensure determinism/reproducability | |
void | validate () |
Protected Attributes | |
int | m_numHandles |
int | m_maxHandles |
int | m_LastHandleIndex |
btSimpleBroadphaseProxy * | m_pHandles |
void * | m_pHandlesRawPtr |
int | m_firstFreeHandle |
btOverlappingPairCache * | m_pairCache |
bool | m_ownsPairCache |
int | m_invalidPair |
The SimpleBroadphase is just a unit-test for btAxisSweep3, bt32BitAxisSweep3, or btDbvtBroadphase, so use those classes instead. It is a brute force aabb culling broadphase based on O(n^2) aabb checks
Definition at line 49 of file btSimpleBroadphase.h.
btSimpleBroadphase::btSimpleBroadphase | ( | int | maxProxies = 16384 , |
btOverlappingPairCache * | overlappingPairCache = 0 |
||
) |
Definition at line 41 of file btSimpleBroadphase.cpp.
References btAlignedAlloc, i, m_firstFreeHandle, m_LastHandleIndex, m_maxHandles, m_numHandles, m_ownsPairCache, m_pairCache, m_pHandles, m_pHandlesRawPtr, and btSimpleBroadphaseProxy::SetNextFree().
btSimpleBroadphase::~btSimpleBroadphase | ( | ) | [virtual] |
Definition at line 75 of file btSimpleBroadphase.cpp.
References btAlignedFree, m_ownsPairCache, m_pairCache, m_pHandlesRawPtr, and btOverlappingPairCache::~btOverlappingPairCache().
bool btSimpleBroadphase::aabbOverlap | ( | btSimpleBroadphaseProxy * | proxy0, |
btSimpleBroadphaseProxy * | proxy1 | ||
) | [static] |
Definition at line 193 of file btSimpleBroadphase.cpp.
Referenced by calculateOverlappingPairs(), CheckOverlapCallback::processOverlap(), and testAabbOverlap().
void btSimpleBroadphase::aabbTest | ( | const btVector3 & | aabbMin, |
const btVector3 & | aabbMax, | ||
btBroadphaseAabbCallback & | callback | ||
) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 171 of file btSimpleBroadphase.cpp.
References i, m_LastHandleIndex, m_pHandles, btBroadphaseAabbCallback::process(), and TestAabbAgainstAabb2().
int btSimpleBroadphase::allocHandle | ( | ) | [inline, protected] |
Definition at line 63 of file btSimpleBroadphase.h.
References btAssert, freeHandle(), btSimpleBroadphaseProxy::GetNextFree(), m_firstFreeHandle, m_LastHandleIndex, m_maxHandles, m_numHandles, and m_pHandles.
Referenced by createProxy().
void btSimpleBroadphase::calculateOverlappingPairs | ( | btDispatcher * | dispatcher | ) | [virtual] |
calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
if you don't like to skip the invalid pairs in the array, execute following code:
Implements btBroadphaseInterface.
Definition at line 213 of file btSimpleBroadphase.cpp.
References aabbOverlap(), btOverlappingPairCallback::addOverlappingPair(), btAssert, btOverlappingPairCache::cleanOverlappingPair(), btOverlappingPairCache::findPair(), btOverlappingPairCache::getOverlappingPairArray(), getSimpleProxyFromProxy(), gOverlappingPairs, btOverlappingPairCache::hasDeferredRemoval(), i, m_invalidPair, m_LastHandleIndex, m_numHandles, m_ownsPairCache, m_pairCache, m_pHandles, btAlignedObjectArray< T >::quickSort(), btOverlappingPairCallback::removeOverlappingPair(), btAlignedObjectArray< T >::resize(), btAlignedObjectArray< T >::size(), and testAabbOverlap().
btBroadphaseProxy * btSimpleBroadphase::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 87 of file btSimpleBroadphase.cpp.
References allocHandle(), btAssert, m_maxHandles, m_numHandles, and m_pHandles.
void btSimpleBroadphase::destroyProxy | ( | btBroadphaseProxy * | proxy, |
btDispatcher * | dispatcher | ||
) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 131 of file btSimpleBroadphase.cpp.
References freeHandle(), m_pairCache, and btOverlappingPairCallback::removeOverlappingPairsContainingProxy().
void btSimpleBroadphase::freeHandle | ( | btSimpleBroadphaseProxy * | proxy | ) | [inline, protected] |
Definition at line 76 of file btSimpleBroadphase.h.
References btAssert, m_firstFreeHandle, m_LastHandleIndex, m_maxHandles, m_numHandles, m_pHandles, and btSimpleBroadphaseProxy::SetNextFree().
Referenced by allocHandle(), and destroyProxy().
void btSimpleBroadphase::getAabb | ( | btBroadphaseProxy * | proxy, |
btVector3 & | aabbMin, | ||
btVector3 & | aabbMax | ||
) | const [virtual] |
Implements btBroadphaseInterface.
Definition at line 143 of file btSimpleBroadphase.cpp.
References getSimpleProxyFromProxy().
virtual void btSimpleBroadphase::getBroadphaseAabb | ( | btVector3 & | aabbMin, |
btVector3 & | aabbMax | ||
) | const [inline, virtual] |
getAabb returns the axis aligned bounding box in the 'global' coordinate frame will add some transform later
Implements btBroadphaseInterface.
Definition at line 155 of file btSimpleBroadphase.h.
References BT_LARGE_FLOAT.
const btOverlappingPairCache* btSimpleBroadphase::getOverlappingPairCache | ( | ) | const [inline, virtual] |
Implements btBroadphaseInterface.
Definition at line 145 of file btSimpleBroadphase.h.
References m_pairCache.
btOverlappingPairCache* btSimpleBroadphase::getOverlappingPairCache | ( | ) | [inline, virtual] |
Implements btBroadphaseInterface.
Definition at line 141 of file btSimpleBroadphase.h.
References m_pairCache.
btSimpleBroadphaseProxy* btSimpleBroadphase::getSimpleProxyFromProxy | ( | btBroadphaseProxy * | proxy | ) | [inline, protected] |
Definition at line 99 of file btSimpleBroadphase.h.
Referenced by calculateOverlappingPairs(), getAabb(), setAabb(), and testAabbOverlap().
const btSimpleBroadphaseProxy* btSimpleBroadphase::getSimpleProxyFromProxy | ( | btBroadphaseProxy * | proxy | ) | const [inline, protected] |
Definition at line 105 of file btSimpleBroadphase.h.
virtual void btSimpleBroadphase::printStats | ( | ) | [inline, virtual] |
Implements btBroadphaseInterface.
Definition at line 161 of file btSimpleBroadphase.h.
void btSimpleBroadphase::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 157 of file btSimpleBroadphase.cpp.
References i, m_LastHandleIndex, m_pHandles, and btBroadphaseAabbCallback::process().
void btSimpleBroadphase::resetPool | ( | btDispatcher * | dispatcher | ) | [protected, virtual] |
reset broadphase internal structures, to ensure determinism/reproducability
Reimplemented from btBroadphaseInterface.
Definition at line 346 of file btSimpleBroadphase.cpp.
void btSimpleBroadphase::setAabb | ( | btBroadphaseProxy * | proxy, |
const btVector3 & | aabbMin, | ||
const btVector3 & | aabbMax, | ||
btDispatcher * | dispatcher | ||
) | [virtual] |
Implements btBroadphaseInterface.
Definition at line 150 of file btSimpleBroadphase.cpp.
References getSimpleProxyFromProxy().
bool btSimpleBroadphase::testAabbOverlap | ( | btBroadphaseProxy * | proxy0, |
btBroadphaseProxy * | proxy1 | ||
) |
Definition at line 339 of file btSimpleBroadphase.cpp.
References aabbOverlap(), and getSimpleProxyFromProxy().
Referenced by calculateOverlappingPairs().
void btSimpleBroadphase::validate | ( | ) | [protected] |
Definition at line 29 of file btSimpleBroadphase.cpp.
References btAssert, i, m_numHandles, and m_pHandles.
int btSimpleBroadphase::m_firstFreeHandle [protected] |
Definition at line 61 of file btSimpleBroadphase.h.
Referenced by allocHandle(), btSimpleBroadphase(), and freeHandle().
int btSimpleBroadphase::m_invalidPair [protected] |
Definition at line 95 of file btSimpleBroadphase.h.
Referenced by calculateOverlappingPairs().
int btSimpleBroadphase::m_LastHandleIndex [protected] |
Definition at line 56 of file btSimpleBroadphase.h.
Referenced by aabbTest(), allocHandle(), btSimpleBroadphase(), calculateOverlappingPairs(), freeHandle(), and rayTest().
int btSimpleBroadphase::m_maxHandles [protected] |
Definition at line 55 of file btSimpleBroadphase.h.
Referenced by allocHandle(), btSimpleBroadphase(), createProxy(), and freeHandle().
int btSimpleBroadphase::m_numHandles [protected] |
Definition at line 54 of file btSimpleBroadphase.h.
Referenced by allocHandle(), btSimpleBroadphase(), calculateOverlappingPairs(), createProxy(), freeHandle(), and validate().
bool btSimpleBroadphase::m_ownsPairCache [protected] |
Definition at line 93 of file btSimpleBroadphase.h.
Referenced by btSimpleBroadphase(), calculateOverlappingPairs(), and ~btSimpleBroadphase().
btOverlappingPairCache* btSimpleBroadphase::m_pairCache [protected] |
Definition at line 92 of file btSimpleBroadphase.h.
Referenced by btSimpleBroadphase(), calculateOverlappingPairs(), destroyProxy(), getOverlappingPairCache(), and ~btSimpleBroadphase().
btSimpleBroadphaseProxy* btSimpleBroadphase::m_pHandles [protected] |
Definition at line 58 of file btSimpleBroadphase.h.
Referenced by aabbTest(), allocHandle(), btSimpleBroadphase(), calculateOverlappingPairs(), createProxy(), freeHandle(), rayTest(), and validate().
void* btSimpleBroadphase::m_pHandlesRawPtr [protected] |
Definition at line 60 of file btSimpleBroadphase.h.
Referenced by btSimpleBroadphase(), and ~btSimpleBroadphase().