Bullet Collision Detection & Physics Library: btSimpleBroadphase Class Reference

Bullet Collision Detection & Physics Library

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btSimpleBroadphase Class Reference

The SimpleBroadphase is just a unit-test for btAxisSweep3, bt32BitAxisSweep3, or btDbvtBroadphase, so use those classes instead. More...

`#include <btSimpleBroadphase.h>`

Inheritance diagram for btSimpleBroadphase:
[legend]
Collaboration diagram for btSimpleBroadphase:
[legend]

## 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, int collisionFilterGroup, int collisionFilterMask, btDispatcher *dispatcher)
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
| getAabb returns the axis aligned bounding box in the 'global' coordinate frame will add some transform later
virtual void | printStats ()
Public Member Functions inherited from btBroadphaseInterface
virtual | ~btBroadphaseInterface ()

## 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

## Detailed Description

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 41 of file btSimpleBroadphase.h.

## Constructor & Destructor Documentation

## ◆ btSimpleBroadphase()

btSimpleBroadphase::btSimpleBroadphase | ( | int | maxProxies = 16384,
|  | btOverlappingPairCache * | overlappingPairCache = 0 )

Definition at line 38 of file btSimpleBroadphase.cpp.

## ◆ ~btSimpleBroadphase()

btSimpleBroadphase::~btSimpleBroadphase | ( |  | ) |
| virtual

Definition at line 68 of file btSimpleBroadphase.cpp.

## Member Function Documentation

## ◆ aabbOverlap()

bool btSimpleBroadphase::aabbOverlap | ( | btSimpleBroadphaseProxy * | proxy0,
|  | btSimpleBroadphaseProxy * | proxy1 )
| static

Definition at line 177 of file btSimpleBroadphase.cpp.

## ◆ aabbTest()

void btSimpleBroadphase::aabbTest | ( | const btVector3 & | aabbMin,
|  | const btVector3 & | aabbMax,
|  | btBroadphaseAabbCallback & | callback )
| virtual

Implements btBroadphaseInterface.

Definition at line 161 of file btSimpleBroadphase.cpp.

## ◆ allocHandle()

int btSimpleBroadphase::allocHandle | ( |  | ) |
| inlineprotected

Definition at line 53 of file btSimpleBroadphase.h.

## ◆ calculateOverlappingPairs()

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 194 of file btSimpleBroadphase.cpp.

## ◆ createProxy()

btBroadphaseProxy * btSimpleBroadphase::createProxy | ( | const btVector3 & | aabbMin,
|  | const btVector3 & | aabbMax,
|  | int | shapeType,
|  | void * | userPtr,
|  | int | collisionFilterGroup,
|  | int | collisionFilterMask,
|  | btDispatcher * | dispatcher )
| virtual

Implements btBroadphaseInterface.

Definition at line 79 of file btSimpleBroadphase.cpp.

## ◆ destroyProxy()

void btSimpleBroadphase::destroyProxy | ( | btBroadphaseProxy * | proxy,
|  | btDispatcher * | dispatcher )
| virtual

Implements btBroadphaseInterface.

Definition at line 124 of file btSimpleBroadphase.cpp.

## ◆ freeHandle()

void btSimpleBroadphase::freeHandle | ( | btSimpleBroadphaseProxy * | proxy | ) |
| inlineprotected

Definition at line 66 of file btSimpleBroadphase.h.

## ◆ getAabb()

void btSimpleBroadphase::getAabb | ( | btBroadphaseProxy * | proxy,
|  | btVector3 & | aabbMin,
|  | btVector3 & | aabbMax ) const
| virtual

Implements btBroadphaseInterface.

Definition at line 134 of file btSimpleBroadphase.cpp.

## ◆ getBroadphaseAabb()

virtual void btSimpleBroadphase::getBroadphaseAabb | ( | btVector3 & | aabbMin,
|  | btVector3 & | aabbMax ) const
| inlinevirtual

getAabb returns the axis aligned bounding box in the 'global' coordinate frame will add some transform later

Implements btBroadphaseInterface.

Definition at line 135 of file btSimpleBroadphase.h.

## ◆ getOverlappingPairCache() [1/2]

btOverlappingPairCache * btSimpleBroadphase::getOverlappingPairCache | ( |  | ) |
| inlinevirtual

Implements btBroadphaseInterface.

Definition at line 122 of file btSimpleBroadphase.h.

## ◆ getOverlappingPairCache() [2/2]

const btOverlappingPairCache * btSimpleBroadphase::getOverlappingPairCache | ( |  | ) | const
| inlinevirtual

Implements btBroadphaseInterface.

Definition at line 126 of file btSimpleBroadphase.h.

## ◆ getSimpleProxyFromProxy() [1/2]

btSimpleBroadphaseProxy * btSimpleBroadphase::getSimpleProxyFromProxy | ( | btBroadphaseProxy * | proxy | ) |
| inlineprotected

Definition at line 87 of file btSimpleBroadphase.h.

## ◆ getSimpleProxyFromProxy() [2/2]

const btSimpleBroadphaseProxy * btSimpleBroadphase::getSimpleProxyFromProxy | ( | btBroadphaseProxy * | proxy | ) | const
| inlineprotected

Definition at line 93 of file btSimpleBroadphase.h.

## ◆ printStats()

virtual void btSimpleBroadphase::printStats | ( |  | ) |
| inlinevirtual

Implements btBroadphaseInterface.

Definition at line 141 of file btSimpleBroadphase.h.

## ◆ rayTest()

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 148 of file btSimpleBroadphase.cpp.

## ◆ resetPool()

void btSimpleBroadphase::resetPool | ( | btDispatcher * | dispatcher | ) |
| protectedvirtual

reset broadphase internal structures, to ensure determinism/reproducability

Reimplemented from btBroadphaseInterface.

Definition at line 322 of file btSimpleBroadphase.cpp.

## ◆ setAabb()

void btSimpleBroadphase::setAabb | ( | btBroadphaseProxy * | proxy,
|  | const btVector3 & | aabbMin,
|  | const btVector3 & | aabbMax,
|  | btDispatcher * | dispatcher )
| virtual

Implements btBroadphaseInterface.

Definition at line 141 of file btSimpleBroadphase.cpp.

## ◆ testAabbOverlap()

bool btSimpleBroadphase::testAabbOverlap | ( | btBroadphaseProxy * | proxy0,
|  | btBroadphaseProxy * | proxy1 )

Definition at line 315 of file btSimpleBroadphase.cpp.

## ◆ validate()

void btSimpleBroadphase::validate | ( |  | ) |
| protected

Definition at line 27 of file btSimpleBroadphase.cpp.

## Member Data Documentation

## ◆ m_firstFreeHandle

int btSimpleBroadphase::m_firstFreeHandle
| protected

Definition at line 51 of file btSimpleBroadphase.h.

## ◆ m_invalidPair

int btSimpleBroadphase::m_invalidPair
| protected

Definition at line 85 of file btSimpleBroadphase.h.

## ◆ m_LastHandleIndex

int btSimpleBroadphase::m_LastHandleIndex
| protected

Definition at line 46 of file btSimpleBroadphase.h.

## ◆ m_maxHandles

int btSimpleBroadphase::m_maxHandles
| protected

Definition at line 45 of file btSimpleBroadphase.h.

## ◆ m_numHandles

int btSimpleBroadphase::m_numHandles
| protected

Definition at line 44 of file btSimpleBroadphase.h.

## ◆ m_ownsPairCache

bool btSimpleBroadphase::m_ownsPairCache
| protected

Definition at line 83 of file btSimpleBroadphase.h.

## ◆ m_pairCache

btOverlappingPairCache* btSimpleBroadphase::m_pairCache
| protected

Definition at line 82 of file btSimpleBroadphase.h.

## ◆ m_pHandles

btSimpleBroadphaseProxy* btSimpleBroadphase::m_pHandles
| protected

Definition at line 48 of file btSimpleBroadphase.h.

## ◆ m_pHandlesRawPtr

void* btSimpleBroadphase::m_pHandlesRawPtr
| protected

Definition at line 50 of file btSimpleBroadphase.h.

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

- btSimpleBroadphase.h
- btSimpleBroadphase.cpp