Public Member Functions | Protected Member Functions | Protected Attributes

btGpu3DGridBroadphase Class Reference

The btGpu3DGridBroadphase uses GPU-style code compiled for CPU to compute overlapping pairs. More...

#include <btGpu3DGridBroadphase.h>

Inheritance diagram for btGpu3DGridBroadphase:
Inheritance graph
[legend]
Collaboration diagram for btGpu3DGridBroadphase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 btGpu3DGridBroadphase (const btVector3 &worldAabbMin, const btVector3 &worldAabbMax, int gridSizeX, int gridSizeY, int gridSizeZ, int maxSmallProxies, int maxLargeProxies, int maxPairsPerBody, int maxBodiesPerCell=8, btScalar cellFactorAABB=btScalar(1.0f))
 btGpu3DGridBroadphase (btOverlappingPairCache *overlappingPairCache, const btVector3 &worldAabbMin, const btVector3 &worldAabbMax, int gridSizeX, int gridSizeY, int gridSizeZ, int maxSmallProxies, int maxLargeProxies, int maxPairsPerBody, int maxBodiesPerCell=8, btScalar cellFactorAABB=btScalar(1.0f))
virtual ~btGpu3DGridBroadphase ()
virtual void calculateOverlappingPairs (btDispatcher *dispatcher)
 calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
virtual btBroadphaseProxycreateProxy (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 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 resetPool (btDispatcher *dispatcher)
 reset broadphase internal structures, to ensure determinism/reproducability

Protected Member Functions

int allocLargeHandle ()
void freeLargeHandle (btSimpleBroadphaseProxy *proxy)
bool isLargeProxy (const btVector3 &aabbMin, const btVector3 &aabbMax)
bool isLargeProxy (btBroadphaseProxy *proxy)
void _initialize (const btVector3 &worldAabbMin, const btVector3 &worldAabbMax, int gridSizeX, int gridSizeY, int gridSizeZ, int maxSmallProxies, int maxLargeProxies, int maxPairsPerBody, int maxBodiesPerCell=8, btScalar cellFactorAABB=btScalar(1.0f))
void _finalize ()
void addPairsToCache (btDispatcher *dispatcher)
void addLarge2LargePairsToCache (btDispatcher *dispatcher)
virtual void setParameters (bt3DGridBroadphaseParams *hostParams)
virtual void prepareAABB ()
virtual void calcHashAABB ()
virtual void sortHash ()
virtual void findCellStart ()
virtual void findOverlappingPairs ()
virtual void findPairsLarge ()
virtual void computePairCacheChanges ()
virtual void scanOverlappingPairBuff ()
virtual void squeezeOverlappingPairBuff ()

Protected Attributes

bool m_bInitialized
unsigned int m_numBodies
unsigned int m_numCells
unsigned int m_maxPairsPerBody
btScalar m_cellFactorAABB
unsigned int m_maxBodiesPerCell
bt3DGridBroadphaseParams m_params
btScalar m_maxRadius
unsigned int * m_hBodiesHash
unsigned int * m_hCellStart
unsigned int * m_hPairBuffStartCurr
bt3DGrid3F1Um_hAABB
unsigned int * m_hPairBuff
unsigned int * m_hPairScan
unsigned int * m_hPairOut
int m_numLargeHandles
int m_maxLargeHandles
int m_LastLargeHandleIndex
btSimpleBroadphaseProxym_pLargeHandles
void * m_pLargeHandlesRawPtr
int m_firstFreeLargeHandle
unsigned int m_numPairsAdded
unsigned int m_numPairsRemoved
unsigned int m_numOverflows

Detailed Description

The btGpu3DGridBroadphase uses GPU-style code compiled for CPU to compute overlapping pairs.

Definition at line 31 of file btGpu3DGridBroadphase.h.


Constructor & Destructor Documentation

btGpu3DGridBroadphase::btGpu3DGridBroadphase ( const btVector3 worldAabbMin,
const btVector3 worldAabbMax,
int  gridSizeX,
int  gridSizeY,
int  gridSizeZ,
int  maxSmallProxies,
int  maxLargeProxies,
int  maxPairsPerBody,
int  maxBodiesPerCell = 8,
btScalar  cellFactorAABB = btScalar(1.0f) 
)

Definition at line 46 of file btGpu3DGridBroadphase.cpp.

btGpu3DGridBroadphase::btGpu3DGridBroadphase ( btOverlappingPairCache overlappingPairCache,
const btVector3 worldAabbMin,
const btVector3 worldAabbMax,
int  gridSizeX,
int  gridSizeY,
int  gridSizeZ,
int  maxSmallProxies,
int  maxLargeProxies,
int  maxPairsPerBody,
int  maxBodiesPerCell = 8,
btScalar  cellFactorAABB = btScalar(1.0f) 
)

Definition at line 64 of file btGpu3DGridBroadphase.cpp.

btGpu3DGridBroadphase::~btGpu3DGridBroadphase (  )  [virtual]

Definition at line 81 of file btGpu3DGridBroadphase.cpp.


Member Function Documentation

void btGpu3DGridBroadphase::_finalize (  )  [protected]

Definition at line 176 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::_initialize ( const btVector3 worldAabbMin,
const btVector3 worldAabbMax,
int  gridSizeX,
int  gridSizeY,
int  gridSizeZ,
int  maxSmallProxies,
int  maxLargeProxies,
int  maxPairsPerBody,
int  maxBodiesPerCell = 8,
btScalar  cellFactorAABB = btScalar(1.0f) 
) [protected]

Definition at line 90 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::addLarge2LargePairsToCache ( btDispatcher dispatcher  )  [protected]

Definition at line 348 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::addPairsToCache ( btDispatcher dispatcher  )  [protected]

Definition at line 226 of file btGpu3DGridBroadphase.cpp.

int btGpu3DGridBroadphase::allocLargeHandle (  )  [inline, protected]

Definition at line 57 of file btGpu3DGridBroadphase.h.

void btGpu3DGridBroadphase::calcHashAABB (  )  [protected, virtual]

Definition at line 485 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::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:

Reimplemented from btSimpleBroadphase.

Definition at line 192 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::computePairCacheChanges (  )  [protected, virtual]

Definition at line 556 of file btGpu3DGridBroadphase.cpp.

btBroadphaseProxy * btGpu3DGridBroadphase::createProxy ( const btVector3 aabbMin,
const btVector3 aabbMax,
int  shapeType,
void *  userPtr,
short int  collisionFilterGroup,
short int  collisionFilterMask,
btDispatcher dispatcher,
void *  multiSapProxy 
) [virtual]

you have to increase the cell size, so 'large' proxies become 'small' proxies (fitting a cell)

Reimplemented from btSimpleBroadphase.

Definition at line 271 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::destroyProxy ( btBroadphaseProxy proxy,
btDispatcher dispatcher 
) [virtual]

Reimplemented from btSimpleBroadphase.

Definition at line 296 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::findCellStart (  )  [protected, virtual]

Definition at line 529 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::findOverlappingPairs (  )  [protected, virtual]

Definition at line 538 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::findPairsLarge (  )  [protected, virtual]

Definition at line 547 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::freeLargeHandle ( btSimpleBroadphaseProxy proxy  )  [inline, protected]

Definition at line 69 of file btGpu3DGridBroadphase.h.

bool btGpu3DGridBroadphase::isLargeProxy ( btBroadphaseProxy proxy  )  [protected]

Definition at line 341 of file btGpu3DGridBroadphase.cpp.

bool btGpu3DGridBroadphase::isLargeProxy ( const btVector3 aabbMin,
const btVector3 aabbMax 
) [protected]

use the bounding sphere radius of this bounding box, to include rotation

Definition at line 328 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::prepareAABB (  )  [protected, virtual]

Definition at line 418 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::rayTest ( const btVector3 rayFrom,
const btVector3 rayTo,
btBroadphaseRayCallback rayCallback,
const btVector3 aabbMin = btVector3(0,0,0),
const btVector3 aabbMax = btVector3(0,0,0) 
) [virtual]

Reimplemented from btSimpleBroadphase.

Definition at line 396 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::resetPool ( btDispatcher dispatcher  )  [virtual]

reset broadphase internal structures, to ensure determinism/reproducability

Reimplemented from btSimpleBroadphase.

Definition at line 315 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::scanOverlappingPairBuff (  )  [protected, virtual]

Definition at line 565 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::setParameters ( bt3DGridBroadphaseParams hostParams  )  [protected, virtual]

Definition at line 477 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::sortHash (  )  [protected, virtual]

Definition at line 494 of file btGpu3DGridBroadphase.cpp.

void btGpu3DGridBroadphase::squeezeOverlappingPairBuff (  )  [protected, virtual]

Definition at line 579 of file btGpu3DGridBroadphase.cpp.


Member Data Documentation

Definition at line 34 of file btGpu3DGridBroadphase.h.

Definition at line 38 of file btGpu3DGridBroadphase.h.

Definition at line 56 of file btGpu3DGridBroadphase.h.

Definition at line 46 of file btGpu3DGridBroadphase.h.

unsigned int* btGpu3DGridBroadphase::m_hBodiesHash [protected]

Definition at line 43 of file btGpu3DGridBroadphase.h.

unsigned int* btGpu3DGridBroadphase::m_hCellStart [protected]

Definition at line 44 of file btGpu3DGridBroadphase.h.

unsigned int* btGpu3DGridBroadphase::m_hPairBuff [protected]

Definition at line 47 of file btGpu3DGridBroadphase.h.

Definition at line 45 of file btGpu3DGridBroadphase.h.

unsigned int* btGpu3DGridBroadphase::m_hPairOut [protected]

Definition at line 49 of file btGpu3DGridBroadphase.h.

unsigned int* btGpu3DGridBroadphase::m_hPairScan [protected]

Definition at line 48 of file btGpu3DGridBroadphase.h.

Definition at line 53 of file btGpu3DGridBroadphase.h.

Definition at line 39 of file btGpu3DGridBroadphase.h.

Definition at line 52 of file btGpu3DGridBroadphase.h.

unsigned int btGpu3DGridBroadphase::m_maxPairsPerBody [protected]

Definition at line 37 of file btGpu3DGridBroadphase.h.

Definition at line 41 of file btGpu3DGridBroadphase.h.

unsigned int btGpu3DGridBroadphase::m_numBodies [protected]

Definition at line 35 of file btGpu3DGridBroadphase.h.

unsigned int btGpu3DGridBroadphase::m_numCells [protected]

Definition at line 36 of file btGpu3DGridBroadphase.h.

Definition at line 51 of file btGpu3DGridBroadphase.h.

unsigned int btGpu3DGridBroadphase::m_numOverflows [protected]

Definition at line 87 of file btGpu3DGridBroadphase.h.

unsigned int btGpu3DGridBroadphase::m_numPairsAdded [protected]

Definition at line 85 of file btGpu3DGridBroadphase.h.

unsigned int btGpu3DGridBroadphase::m_numPairsRemoved [protected]

Definition at line 86 of file btGpu3DGridBroadphase.h.

Definition at line 40 of file btGpu3DGridBroadphase.h.

Definition at line 54 of file btGpu3DGridBroadphase.h.

Definition at line 55 of file btGpu3DGridBroadphase.h.


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