Bullet Collision Detection & Physics Library
|
CollisionWorld is interface and container for the collision detection. More...
#include <btCollisionWorld.h>
Classes | |
struct | AllHitsRayResultCallback |
struct | ClosestConvexResultCallback |
struct | ClosestRayResultCallback |
struct | ContactResultCallback |
ContactResultCallback is used to report contact points. More... | |
struct | ConvexResultCallback |
RayResultCallback is used to report new raycast results. More... | |
struct | LocalConvexResult |
struct | LocalRayResult |
struct | LocalShapeInfo |
LocalShapeInfo gives extra information for complex shapes Currently, only btTriangleMeshShape is available, so it just contains triangleIndex and subpart. More... | |
struct | RayResultCallback |
RayResultCallback is used to report new raycast results. More... | |
Public Member Functions | |
btCollisionWorld (btDispatcher *dispatcher, btBroadphaseInterface *broadphasePairCache, btCollisionConfiguration *collisionConfiguration) | |
for debug drawing More... | |
virtual | ~btCollisionWorld () |
void | setBroadphase (btBroadphaseInterface *pairCache) |
const btBroadphaseInterface * | getBroadphase () const |
btBroadphaseInterface * | getBroadphase () |
btOverlappingPairCache * | getPairCache () |
btDispatcher * | getDispatcher () |
const btDispatcher * | getDispatcher () const |
void | updateSingleAabb (btCollisionObject *colObj) |
virtual void | updateAabbs () |
virtual void | computeOverlappingPairs () |
the computeOverlappingPairs is usually already called by performDiscreteCollisionDetection (or stepSimulation) it can be useful to use if you perform ray tests without collision detection/simulation More... | |
virtual void | setDebugDrawer (btIDebugDraw *debugDrawer) |
virtual btIDebugDraw * | getDebugDrawer () |
virtual void | debugDrawWorld () |
virtual void | debugDrawObject (const btTransform &worldTransform, const btCollisionShape *shape, const btVector3 &color) |
int | getNumCollisionObjects () const |
virtual void | rayTest (const btVector3 &rayFromWorld, const btVector3 &rayToWorld, RayResultCallback &resultCallback) const |
rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback. More... | |
void | convexSweepTest (const btConvexShape *castShape, const btTransform &from, const btTransform &to, ConvexResultCallback &resultCallback, btScalar allowedCcdPenetration=btScalar(0.)) const |
convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback. More... | |
void | contactTest (btCollisionObject *colObj, ContactResultCallback &resultCallback) |
contactTest performs a discrete collision test between colObj against all objects in the btCollisionWorld, and calls the resultCallback. More... | |
void | contactPairTest (btCollisionObject *colObjA, btCollisionObject *colObjB, ContactResultCallback &resultCallback) |
contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected. More... | |
virtual void | addCollisionObject (btCollisionObject *collisionObject, short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, short int collisionFilterMask=btBroadphaseProxy::AllFilter) |
btCollisionObjectArray & | getCollisionObjectArray () |
const btCollisionObjectArray & | getCollisionObjectArray () const |
virtual void | removeCollisionObject (btCollisionObject *collisionObject) |
virtual void | performDiscreteCollisionDetection () |
btDispatcherInfo & | getDispatchInfo () |
const btDispatcherInfo & | getDispatchInfo () const |
bool | getForceUpdateAllAabbs () const |
void | setForceUpdateAllAabbs (bool forceUpdateAllAabbs) |
virtual void | serialize (btSerializer *serializer) |
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bullet/Demos/SerializeDemo) More... | |
Static Public Member Functions | |
static void | rayTestSingle (const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback) |
rayTestSingle performs a raycast call and calls the resultCallback. More... | |
static void | rayTestSingleInternal (const btTransform &rayFromTrans, const btTransform &rayToTrans, const btCollisionObjectWrapper *collisionObjectWrap, RayResultCallback &resultCallback) |
static void | objectQuerySingle (const btConvexShape *castShape, const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, ConvexResultCallback &resultCallback, btScalar allowedPenetration) |
objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest. More... | |
static void | objectQuerySingleInternal (const btConvexShape *castShape, const btTransform &convexFromTrans, const btTransform &convexToTrans, const btCollisionObjectWrapper *colObjWrap, ConvexResultCallback &resultCallback, btScalar allowedPenetration) |
Protected Member Functions | |
void | serializeCollisionObjects (btSerializer *serializer) |
Protected Attributes | |
btAlignedObjectArray < btCollisionObject * > | m_collisionObjects |
btDispatcher * | m_dispatcher1 |
btDispatcherInfo | m_dispatchInfo |
btBroadphaseInterface * | m_broadphasePairCache |
btIDebugDraw * | m_debugDrawer |
bool | m_forceUpdateAllAabbs |
m_forceUpdateAllAabbs can be set to false as an optimization to only update active object AABBs it is true by default, because it is error-prone (setting the position of static objects wouldn't update their AABB) More... | |
CollisionWorld is interface and container for the collision detection.
Definition at line 88 of file btCollisionWorld.h.
btCollisionWorld::btCollisionWorld | ( | btDispatcher * | dispatcher, |
btBroadphaseInterface * | broadphasePairCache, | ||
btCollisionConfiguration * | collisionConfiguration | ||
) |
for debug drawing
Definition at line 69 of file btCollisionWorld.cpp.
|
virtual |
Definition at line 78 of file btCollisionWorld.cpp.
|
virtual |
Reimplemented in btDiscreteDynamicsWorld.
Definition at line 111 of file btCollisionWorld.cpp.
|
virtual |
the computeOverlappingPairs is usually already called by performDiscreteCollisionDetection (or stepSimulation) it can be useful to use if you perform ray tests without collision detection/simulation
Definition at line 208 of file btCollisionWorld.cpp.
void btCollisionWorld::contactPairTest | ( | btCollisionObject * | colObjA, |
btCollisionObject * | colObjB, | ||
ContactResultCallback & | resultCallback | ||
) |
contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected.
it reports one or more contact points (including the one with deepest penetration)
Definition at line 1185 of file btCollisionWorld.cpp.
void btCollisionWorld::contactTest | ( | btCollisionObject * | colObj, |
ContactResultCallback & | resultCallback | ||
) |
contactTest performs a discrete collision test between colObj against all objects in the btCollisionWorld, and calls the resultCallback.
contactTest performs a discrete collision test against all objects in the btCollisionWorld, and calls the resultCallback.
it reports one or more contact points for every overlapping object (including the one with deepest penetration)
Definition at line 1173 of file btCollisionWorld.cpp.
void btCollisionWorld::convexSweepTest | ( | const btConvexShape * | castShape, |
const btTransform & | from, | ||
const btTransform & | to, | ||
ConvexResultCallback & | resultCallback, | ||
btScalar | allowedCcdPenetration = btScalar(0.) |
||
) | const |
convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.
use the broadphase to accelerate the search for objects, based on their aabb and for each object with ray-aabb overlap, perform an exact ray test unfortunately the implementation for rayTest and convexSweepTest duplicated, albeit practically identical
Definition at line 1007 of file btCollisionWorld.cpp.
|
virtual |
for polyhedral shapes
Definition at line 1251 of file btCollisionWorld.cpp.
|
virtual |
Reimplemented in btDiscreteDynamicsWorld, btDynamicsWorld, btSimpleDynamicsWorld, and btSoftRigidDynamicsWorld.
Definition at line 1430 of file btCollisionWorld.cpp.
|
inline |
Definition at line 122 of file btCollisionWorld.h.
|
inline |
Definition at line 127 of file btCollisionWorld.h.
|
inline |
Definition at line 486 of file btCollisionWorld.h.
|
inline |
Definition at line 491 of file btCollisionWorld.h.
|
inlinevirtual |
Definition at line 162 of file btCollisionWorld.h.
|
inline |
Definition at line 138 of file btCollisionWorld.h.
|
inline |
Definition at line 143 of file btCollisionWorld.h.
|
inline |
Definition at line 501 of file btCollisionWorld.h.
|
inline |
Definition at line 506 of file btCollisionWorld.h.
|
inline |
Definition at line 511 of file btCollisionWorld.h.
|
inline |
Definition at line 438 of file btCollisionWorld.h.
|
inline |
Definition at line 132 of file btCollisionWorld.h.
|
static |
objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest.
Definition at line 577 of file btCollisionWorld.cpp.
|
static |
Definition at line 587 of file btCollisionWorld.cpp.
|
virtual |
Definition at line 214 of file btCollisionWorld.cpp.
|
virtual |
rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
use the broadphase to accelerate the search for objects, based on their aabb and for each object with ray-aabb overlap, perform an exact ray test
Reimplemented in btSoftRigidDynamicsWorld.
Definition at line 929 of file btCollisionWorld.cpp.
|
static |
rayTestSingle performs a raycast call and calls the resultCallback.
It is used internally by rayTest. In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape. This allows more customization.
Definition at line 262 of file btCollisionWorld.cpp.
|
static |
optimized version for btBvhTriangleMeshShape
Definition at line 272 of file btCollisionWorld.cpp.
|
virtual |
Reimplemented in btDiscreteDynamicsWorld, btSimpleDynamicsWorld, and btSoftRigidDynamicsWorld.
Definition at line 235 of file btCollisionWorld.cpp.
|
virtual |
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bullet/Demos/SerializeDemo)
Reimplemented in btDiscreteDynamicsWorld, and btSoftRigidDynamicsWorld.
Definition at line 1543 of file btCollisionWorld.cpp.
|
protected |
keep track of shapes already serialized
Definition at line 1512 of file btCollisionWorld.cpp.
|
inline |
Definition at line 117 of file btCollisionWorld.h.
|
inlinevirtual |
Definition at line 157 of file btCollisionWorld.h.
|
inline |
Definition at line 515 of file btCollisionWorld.h.
|
virtual |
Reimplemented in btSimpleDynamicsWorld.
Definition at line 190 of file btCollisionWorld.cpp.
void btCollisionWorld::updateSingleAabb | ( | btCollisionObject * | colObj | ) |
Definition at line 147 of file btCollisionWorld.cpp.
|
protected |
Definition at line 100 of file btCollisionWorld.h.
|
protected |
Definition at line 94 of file btCollisionWorld.h.
|
protected |
Definition at line 102 of file btCollisionWorld.h.
|
protected |
Definition at line 96 of file btCollisionWorld.h.
|
protected |
Definition at line 98 of file btCollisionWorld.h.
|
protected |
m_forceUpdateAllAabbs can be set to false as an optimization to only update active object AABBs it is true by default, because it is error-prone (setting the position of static objects wouldn't update their AABB)
Definition at line 106 of file btCollisionWorld.h.