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, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter) |
virtual void | refreshBroadphaseProxy (btCollisionObject *collisionObject) |
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) |
void | serializeContactManifolds (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 85 of file btCollisionWorld.h.
btCollisionWorld::btCollisionWorld | ( | btDispatcher * | dispatcher, |
btBroadphaseInterface * | broadphasePairCache, | ||
btCollisionConfiguration * | collisionConfiguration | ||
) |
for debug drawing
Definition at line 67 of file btCollisionWorld.cpp.
|
virtual |
Definition at line 75 of file btCollisionWorld.cpp.
|
virtual |
Reimplemented in btDiscreteDynamicsWorld.
Definition at line 124 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 214 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 1242 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 1231 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 1075 of file btCollisionWorld.cpp.
|
virtual |
for polyhedral shapes
Definition at line 1300 of file btCollisionWorld.cpp.
|
virtual |
Reimplemented in btDiscreteDynamicsWorld, btSimpleDynamicsWorld, btMultiBodyDynamicsWorld, btDeformableMultiBodyDynamicsWorld, btSoftMultiBodyDynamicsWorld, btSoftRigidDynamicsWorld, and btDynamicsWorld.
Definition at line 1467 of file btCollisionWorld.cpp.
|
inline |
Definition at line 122 of file btCollisionWorld.h.
|
inline |
Definition at line 117 of file btCollisionWorld.h.
|
inline |
Definition at line 476 of file btCollisionWorld.h.
|
inline |
Definition at line 481 of file btCollisionWorld.h.
|
inlinevirtual |
Definition at line 155 of file btCollisionWorld.h.
|
inline |
Definition at line 132 of file btCollisionWorld.h.
|
inline |
Definition at line 137 of file btCollisionWorld.h.
|
inline |
Definition at line 490 of file btCollisionWorld.h.
|
inline |
Definition at line 495 of file btCollisionWorld.h.
|
inline |
Definition at line 500 of file btCollisionWorld.h.
|
inline |
Definition at line 427 of file btCollisionWorld.h.
|
inline |
Definition at line 127 of file btCollisionWorld.h.
|
static |
objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest.
Definition at line 601 of file btCollisionWorld.cpp.
|
static |
Definition at line 611 of file btCollisionWorld.cpp.
|
virtual |
Definition at line 220 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 btDeformableMultiBodyDynamicsWorld, btSoftMultiBodyDynamicsWorld, and btSoftRigidDynamicsWorld.
Definition at line 1003 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 276 of file btCollisionWorld.cpp.
|
static |
optimized version for btBvhTriangleMeshShape
optimized version for btScaledBvhTriangleMeshShape
optimized version for btHeightfieldTerrainShape
Definition at line 286 of file btCollisionWorld.cpp.
|
virtual |
Definition at line 96 of file btCollisionWorld.cpp.
|
virtual |
Reimplemented in btDiscreteDynamicsWorld, btSimpleDynamicsWorld, btDeformableMultiBodyDynamicsWorld, btSoftMultiBodyDynamicsWorld, and btSoftRigidDynamicsWorld.
Definition at line 238 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, btMultiBodyDynamicsWorld, btSoftMultiBodyDynamicsWorld, and btSoftRigidDynamicsWorld.
Definition at line 1615 of file btCollisionWorld.cpp.
|
protected |
keep track of shapes already serialized
Definition at line 1565 of file btCollisionWorld.cpp.
|
protected |
Definition at line 1595 of file btCollisionWorld.cpp.
|
inline |
Definition at line 112 of file btCollisionWorld.h.
|
inlinevirtual |
Definition at line 150 of file btCollisionWorld.h.
|
inline |
Definition at line 504 of file btCollisionWorld.h.
|
virtual |
Reimplemented in btSimpleDynamicsWorld.
Definition at line 197 of file btCollisionWorld.cpp.
void btCollisionWorld::updateSingleAabb | ( | btCollisionObject * | colObj | ) |
Definition at line 153 of file btCollisionWorld.cpp.
|
protected |
Definition at line 94 of file btCollisionWorld.h.
|
protected |
Definition at line 88 of file btCollisionWorld.h.
|
protected |
Definition at line 96 of file btCollisionWorld.h.
|
protected |
Definition at line 90 of file btCollisionWorld.h.
|
protected |
Definition at line 92 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 100 of file btCollisionWorld.h.