Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
68 : m_dispatcher1(dispatcher),
69 m_broadphasePairCache(pairCache),
71 m_forceUpdateAllAabbs(true)
118 collisionFilterGroup,
148 collisionFilterGroup,
159 minAabb -= contactThreshold;
160 maxAabb += contactThreshold;
166 minAabb2 -= contactThreshold;
167 maxAabb2 += contactThreshold;
185 static bool reportMe =
true;
223 BT_PROFILE(
"performDiscreteCollisionDetection");
307 btGjkConvexCast gjkConvexCaster(castShape, convexShape, &simplexSolver);
314 convexCasterPtr = &gjkConvexCaster;
316 convexCasterPtr = &subSimplexConvexCaster;
320 if (convexCaster.
calcTimeOfImpact(rayFromTrans, rayToTrans, colObjWorldTransform, colObjWorldTransform, castResult))
328 #ifdef USE_SUBSIMPLEX_CONVEX_CAST
331 #endif //USE_SUBSIMPLEX_CONVEX_CAST
340 bool normalInWorldSpace =
true;
362 m_resultCallback(resultCallback),
363 m_collisionObject(collisionObject),
364 m_triangleMesh(triangleMesh),
365 m_colObjWorldTransform(colObjWorldTransform)
382 bool normalInWorldSpace =
true;
383 return m_resultCallback->
addSingleResult(rayResult, normalInWorldSpace);
397 BridgeTriangleRaycastCallback rcb(rayFromLocal, rayToLocal, &resultCallback, collisionObjectWrap->
getCollisionObject(), triangleMesh, colObjWorldTransform);
409 btVector3 rayFromLocalScaled = rayFromLocal / scale;
410 btVector3 rayToLocalScaled = rayToLocal / scale;
413 BridgeTriangleRaycastCallback rcb(rayFromLocalScaled, rayToLocalScaled, &resultCallback, collisionObjectWrap->
getCollisionObject(), triangleMesh, colObjWorldTransform);
415 triangleMesh->
performRaycast(&rcb, rayFromLocalScaled, rayToLocalScaled);
427 BridgeTriangleRaycastCallback rcb(rayFromLocal, rayToLocal, &resultCallback, collisionObjectWrap->
getCollisionObject(), heightField, colObjWorldTransform);
454 m_resultCallback(resultCallback),
455 m_collisionObject(collisionObject),
456 m_triangleMesh(triangleMesh),
457 m_colObjWorldTransform(colObjWorldTransform)
474 bool normalInWorldSpace =
true;
475 return m_resultCallback->
addSingleResult(rayResult, normalInWorldSpace);
479 BridgeTriangleRaycastCallback rcb(rayFromLocal, rayToLocal, &resultCallback, collisionObjectWrap->
getCollisionObject(), concaveShape, colObjWorldTransform);
482 btVector3 rayAabbMinLocal = rayFromLocal;
483 rayAabbMinLocal.
setMin(rayToLocal);
484 btVector3 rayAabbMaxLocal = rayFromLocal;
485 rayAabbMaxLocal.
setMax(rayToLocal);
501 : m_userCallback(user), m_i(i)
504 m_flags = m_userCallback->
m_flags;
540 m_compoundShape(compoundShape),
541 m_colObjWorldTransform(colObjWorldTransform),
542 m_rayFromTrans(rayFromTrans),
543 m_rayToTrans(rayToTrans),
544 m_resultCallback(resultCallback)
548 void ProcessLeaf(
int i)
552 btTransform childWorldTrans = m_colObjWorldTransform * childTrans;
557 LocalInfoAdder2 my_cb(i, &m_resultCallback);
578 colObjWorldTransform,
582 #ifndef DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
590 #endif //DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
594 rayCB.ProcessLeaf(i);
636 if (castPtr->
calcTimeOfImpact(convexFromTrans, convexToTrans, colObjWorldTransform, colObjWorldTransform, castResult))
651 bool normalInWorldSpace =
true;
680 m_resultCallback(resultCallback),
681 m_collisionObject(collisionObject),
682 m_triangleMesh(triangleMesh)
691 if (hitFraction <= m_resultCallback->m_closestHitFraction)
699 bool normalInWorldSpace =
true;
701 return m_resultCallback->
addSingleResult(convexResult, normalInWorldSpace);
707 BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans, convexToTrans, &resultCallback, colObjWrap->
getCollisionObject(), triangleMesh, colObjWorldTransform);
709 tccb.m_allowedPenetration = allowedPenetration;
711 castShape->
getAabb(rotationXform, boxMinLocal, boxMaxLocal);
712 triangleMesh->
performConvexcast(&tccb, convexFromLocal, convexToLocal, boxMinLocal, boxMaxLocal);
725 if (castPtr->
calcTimeOfImpact(convexFromTrans, convexToTrans, colObjWorldTransform, colObjWorldTransform, castResult))
740 bool normalInWorldSpace =
true;
765 m_resultCallback(resultCallback),
766 m_collisionObject(collisionObject),
767 m_triangleMesh(triangleMesh)
776 if (hitFraction <= m_resultCallback->m_closestHitFraction)
784 bool normalInWorldSpace =
true;
786 return m_resultCallback->
addSingleResult(convexResult, normalInWorldSpace);
792 BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans, convexToTrans, &resultCallback, colObjWrap->
getCollisionObject(), concaveShape, colObjWorldTransform);
794 tccb.m_allowedPenetration = allowedPenetration;
796 castShape->
getAabb(rotationXform, boxMinLocal, boxMaxLocal);
798 btVector3 rayAabbMinLocal = convexFromLocal;
799 rayAabbMinLocal.
setMin(convexToLocal);
800 btVector3 rayAabbMaxLocal = convexFromLocal;
801 rayAabbMaxLocal.
setMax(convexToLocal);
802 rayAabbMinLocal += boxMinLocal;
803 rayAabbMaxLocal += boxMaxLocal;
823 : m_colObjWrap(colObjWrap),
824 m_castShape(castShape),
825 m_convexFromTrans(convexFromTrans),
826 m_convexToTrans(convexToTrans),
827 m_allowedPenetration(allowedPenetration),
828 m_compoundShape(compoundShape),
829 m_colObjWorldTransform(colObjWorldTransform),
830 m_resultCallback(resultCallback)
846 btTransform childWorldTrans = m_colObjWorldTransform * childTrans;
854 : m_userCallback(user), m_i(i)
875 LocalInfoAdder my_cb(index, &m_resultCallback);
890 ProcessChild(index, childTrans, childCollisionShape);
897 btVector3 fromLocalAabbMin, fromLocalAabbMax;
898 btVector3 toLocalAabbMin, toLocalAabbMax;
900 castShape->
getAabb(colObjWorldTransform.
inverse() * convexFromTrans, fromLocalAabbMin, fromLocalAabbMax);
901 castShape->
getAabb(colObjWorldTransform.
inverse() * convexToTrans, toLocalAabbMin, toLocalAabbMax);
903 fromLocalAabbMin.setMin(toLocalAabbMin);
904 fromLocalAabbMax.
setMax(toLocalAabbMax);
907 allowedPenetration, compoundShape, colObjWorldTransform, resultCallback);
922 callback.ProcessChild(i, childTrans, childCollisionShape);
952 btVector3 rayDir = (rayToWorld - rayFromWorld);
980 #ifdef RECALCULATE_AABB
981 btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
1011 #ifndef USE_BRUTEFORCE_RAYBROADPHASE
1018 #endif //USE_BRUTEFORCE_RAYBROADPHASE
1084 convexFromTrans = convexFromWorld;
1085 convexToTrans = convexToWorld;
1086 btVector3 castShapeAabbMin, castShapeAabbMax;
1099 #ifndef USE_BRUTEFORCE_RAYBROADPHASE
1101 btSingleSweepCallback convexCB(castShape, convexFromWorld, convexToWorld,
this, resultCallback, allowedCcdPenetration);
1116 btVector3 collisionObjectAabbMin, collisionObjectAabbMax;
1118 AabbExpand(collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax);
1121 if (
btRayAabb(convexFromWorld.
getOrigin(), convexToWorld.
getOrigin(), collisionObjectAabbMin, collisionObjectAabbMax, hitLambda, hitNormal))
1128 allowedCcdPenetration);
1132 #endif //USE_BRUTEFORCE_RAYBROADPHASE
1148 btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
1282 (void)triangleIndex;
1292 btVector3 normal = (wv1 - wv0).cross(wv2 - wv0);
1348 for (
int i = multiSphereShape->
getSphereCount() - 1; i >= 0; i--)
1412 int lastV = poly->
m_faces[i].m_indices[numVerts - 1];
1413 for (
int v = 0; v < poly->
m_faces[i].m_indices.
size(); v++)
1415 int curVert = poly->
m_faces[i].m_indices[v];
1426 getDebugDrawer()->
drawLine(worldTransform * centroid, worldTransform * (centroid + faceNormal), normalColor);
1484 for (
int i = 0; i < numManifolds; i++)
1491 for (
int j = 0; j < numContacts; j++)
1546 minAabb -= contactThreshold;
1547 maxAabb += contactThreshold;
1554 minAabb2 -= contactThreshold;
1555 maxAabb2 += contactThreshold;
1556 minAabb.
setMin(minAabb2);
1557 maxAabb.
setMax(maxAabb2);
1580 if (!serializedShapes.
find(shape))
1582 serializedShapes.
insert(shape, shape);
1603 for (
int i = 0; i < numManifolds; i++)
1612 const char* structType = manifold->
serialize(manifold, chunk->
m_oldPtr, serializer);
void updateSingleAabb(btCollisionObject *colObj)
const btCollisionWorld * m_world
btIDebugDraw * m_debugDrawer
The btPolyhedralConvexShape is an internal interface class for polyhedral convex shapes.
const btScalar & getPlaneConstant() const
int m_collisionFilterMask
virtual void setAabb(btBroadphaseProxy *proxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher)=0
btCollisionObject can be used to manage collision detection objects.
#define BT_CONTACTMANIFOLD_CODE
#define DISABLE_SIMULATION
btCollisionWorld::ContactResultCallback & m_resultCallback
@ TERRAIN_SHAPE_PROXYTYPE
Typically the conservative advancement reaches solution in a few iterations, clip it to 32 for degene...
virtual void computeOverlappingPairs()
the computeOverlappingPairs is usually already called by performDiscreteCollisionDetection (or stepSi...
virtual void refreshBroadphaseProxy(btCollisionObject *collisionObject)
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
virtual void serializeSingleShape(btSerializer *serializer) const
The btTriangleMeshShape is an internal concave triangle mesh interface. Don't use this class directly...
@ BT_CLOSEST_POINT_ALGORITHMS
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)
#define DISABLE_DEACTIVATION
@ BT_SERIALIZE_CONTACT_MANIFOLDS
@ CYLINDER_SHAPE_PROXYTYPE
virtual btPersistentManifold ** getInternalManifoldPointer()=0
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.
btSingleSweepCallback(const btConvexShape *castShape, const btTransform &convexFromTrans, const btTransform &convexToTrans, const btCollisionWorld *world, btCollisionWorld::ConvexResultCallback &resultCallback, btScalar allowedPenetration)
virtual ~btCollisionAlgorithm()
virtual btIDebugDraw * getDebugDrawer()
The btConvexTriangleMeshShape is a convex hull of a triangle mesh, but the performance is not as good...
btTransform & getChildTransform(int index)
virtual void drawSphere(btScalar radius, const btTransform &transform, const btVector3 &color)
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
btVector3 getHalfExtentsWithMargin() const
btAlignedObjectArray< btFace > m_faces
@ kF_UseGjkConvexCastRaytest
void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const =0
getAabb's default implementation is brute force, expected derived classes to implement a fast dedicat...
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
The btConcaveShape class provides an interface for non-moving (static) concave shapes.
virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
virtual void debugDrawWorld()
btScalar m_allowedCcdPenetration
void performRaycast(btTriangleCallback *callback, const btVector3 &raySource, const btVector3 &rayTarget)
btSingleRayCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const btCollisionWorld *world, btCollisionWorld::RayResultCallback &resultCallback)
void setWorldArrayIndex(int ix)
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
btVector3 m_normalWorldOnB
virtual void calculateOverlappingPairs(btDispatcher *dispatcher)=0
calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during th...
btTransform m_convexToTrans
const btCollisionObject * getBody0() const
btTransform m_rayFromTrans
virtual ~btCollisionWorld()
int findLinearSearch(const T &key) const
btAlignedObjectArray< btCollisionObject * > m_collisionObjects
virtual int getNumManifolds() const =0
virtual int getDebugMode() const =0
virtual void drawTransform(const btTransform &transform, btScalar orthoLen)
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 resultC...
btScalar dot(const btVector3 &v) const
Return the dot product.
btVector3 m_disabledDeactivationObject
int getNumContacts() const
virtual void InternalProcessAllTriangles(btInternalTriangleIndexCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
int getActivationState() const
btBroadphaseInterface * m_broadphasePairCache
btIDebugDraw * m_debugDrawer
void serializeContactManifolds(btSerializer *serializer)
@ kF_DisableHeightfieldAccelerator
btHeightfieldTerrainShape simulates a 2D heightfield terrain
const btTransform & getWorldTransform() const
virtual btScalar getMargin() const
btScalar getDistance() const
const btBroadphaseInterface * getBroadphase() const
btContinuousConvexCollision implements angular and linear time of impact for convex objects.
int m_collisionFilterGroup
btScalar getHalfHeight() const
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
virtual void setMargin(btScalar margin)
EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to calculate the penetration depth be...
btTransform m_convexFromTrans
btSubsimplexConvexCast implements Gino van den Bergens' paper "Ray Casting against bteral Convex Obje...
virtual void performDiscreteCollisionDetection()
static DBVT_PREFIX void rayTest(const btDbvtNode *root, const btVector3 &rayFrom, const btVector3 &rayTo, DBVT_IPOLICY)
rayTest is a re-entrant ray test, and can be called in parallel as long as the btAlignedAlloc is thre...
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
virtual void freeCollisionAlgorithm(void *ptr)=0
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
bool isStaticOrKinematicObject() const
void contactTest(btCollisionObject *colObj, ContactResultCallback &resultCallback)
contactTest performs a discrete collision test between colObj against all objects in the btCollisionW...
btAlignedObjectArray< btVector3 > m_vertices
const btCollisionObjectWrapper * m_body0Wrap
@ CF_DISABLE_VISUALIZE_OBJECT
btTransform & getWorldTransform()
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....
RayResult stores the closest result alternatively, add a callback method to decide about closest/all ...
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
@ MULTI_SPHERE_SHAPE_PROXYTYPE
btScalar getRadius() const
btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points...
int getConeUpIndex() const
virtual bool process(const btBroadphaseProxy *proxy)
@ CAPSULE_SHAPE_PROXYTYPE
void swap(int index0, int index1)
btCollisionWorld::ConvexResultCallback & m_resultCallback
btScalar m_closestHitFraction
btVector3 m_positionWorldOnB
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
virtual void drawPlane(const btVector3 &planeNormal, btScalar planeConst, const btTransform &transform, const btVector3 &color)
void calculateTemporalAabb(const btTransform &curTrans, const btVector3 &linvel, const btVector3 &angvel, btScalar timeStep, btVector3 &temporalAabbMin, btVector3 &temporalAabbMax) const
calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0....
ManifoldContactPoint collects and maintains persistent contactpoints.
virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
btCollisionWorld::RayResultCallback & m_resultCallback
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes ...
The btMultiSphereShape represents the convex hull of a collection of spheres.
GjkConvexCast performs a raycast on a convex object using support mapping.
btManifoldResult is a helper class to manage contact results.
@ CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE
virtual void getEdge(int i, btVector3 &pa, btVector3 &pb) const =0
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
const btCollisionShape * getCollisionShape() const
const btVector3 & getPlaneNormal() const
void setMax(const btVector3 &other)
Set each element to the max of the current values and the values of another btVector3.
const btVector3 & getSpherePosition(int index) const
void AabbExpand(btVector3 &aabbMin, btVector3 &aabbMax, const btVector3 &expansionMin, const btVector3 &expansionMax)
virtual bool process(const btBroadphaseProxy *proxy)
int calculateSerializeBufferSize() const
btScalar getSphereRadius(int index) const
@ SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE
virtual void drawContactPoint(const btVector3 &PointOnB, const btVector3 &normalOnB, btScalar distance, int lifeTime, const btVector3 &color)=0
virtual void destroyProxy(btBroadphaseProxy *proxy, btDispatcher *dispatcher)=0
void performConvexcast(btTriangleCallback *callback, const btVector3 &boxSource, const btVector3 &boxTarget, const btVector3 &boxMin, const btVector3 &boxMax)
btBroadphaseProxy * getBroadphaseHandle()
virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const =0
getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
virtual bool calcTimeOfImpact(const btTransform &fromA, const btTransform &toA, const btTransform &fromB, const btTransform &toB, CastResult &result)=0
cast a convex against another convex object
DBVT_PREFIX void collideTV(const btDbvtNode *root, const btDbvtVolume &volume, DBVT_IPOLICY) const
const btTransform & getInterpolationWorldTransform() const
DebugDrawcallback(btIDebugDraw *debugDrawer, const btTransform &worldTrans, const btVector3 &color)
int getNumCollisionObjects() 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))=0
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
int getSphereCount() const
int getCollisionFlags() const
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const =0
virtual void finalizeChunk(btChunk *chunk, const char *structType, int chunkCode, void *oldPtr)=0
bool isStaticObject() const
const btCollisionObject * getCollisionObject() const
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
The btSphereShape implements an implicit sphere, centered around a local origin with radius.
btVector3 can be used to represent 3D points and vectors.
virtual void reportErrorWarning(const char *warningString)=0
static void objectQuerySingleInternal(const btConvexShape *castShape, const btTransform &convexFromTrans, const btTransform &convexToTrans, const btCollisionObjectWrapper *colObjWrap, ConvexResultCallback &resultCallback, btScalar allowedPenetration)
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
btPersistentManifold * m_manifoldPtr
static btDbvtAabbMm FromMM(const btVector3 &mi, const btVector3 &mx)
LocalShapeInfo gives extra information for complex shapes Currently, only btTriangleMeshShape is avai...
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
void contactPairTest(btCollisionObject *colObjA, btCollisionObject *colObjB, ContactResultCallback &resultCallback)
contactTest performs a discrete collision test between two collision objects and calls the resultCall...
virtual btScalar getRadius() const
int getWorldArrayIndex() const
virtual void finishSerialization()=0
#define ATTRIBUTE_ALIGNED16(a)
virtual void startSerialization()=0
btVector3 m_disabledSimulationObject
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
virtual void debugDrawObject(const btTransform &worldTransform, const btCollisionShape *shape, const btVector3 &color)
The btConvexShape is an abstract shape interface, implemented by all convex shapes such as btBoxShape...
btBridgedManifoldResult(const btCollisionObjectWrapper *obj0Wrap, const btCollisionObjectWrapper *obj1Wrap, btCollisionWorld::ContactResultCallback &resultCallback)
const Value * find(const Key &key) const
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
virtual void clearLines()
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
void setMin(const btVector3 &other)
Set each element to the min of the current values and the values of another btVector3.
btScalar getHeight() const
virtual void drawBox(const btVector3 &bbMin, const btVector3 &bbMax, const btVector3 &color)
LocalShapeInfo * m_localShapeInfo
virtual void removeCollisionObject(btCollisionObject *collisionObject)
btDispatcher * m_dispatcher1
void setBroadphaseHandle(btBroadphaseProxy *handle)
@ TRIANGLE_MESH_SHAPE_PROXYTYPE
btVector3 m_wantsDeactivationObject
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
btVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity
LocalShapeInfo * m_localShapeInfo
virtual void dispatchAllCollisionPairs(btOverlappingPairCache *pairCache, const btDispatcherInfo &dispatchInfo, btDispatcher *dispatcher)=0
static void rayTestSingleInternal(const btTransform &rayFromTrans, const btTransform &rayToTrans, const btCollisionObjectWrapper *collisionObjectWrap, RayResultCallback &resultCallback)
void insert(const Key &key, const Value &value)
virtual void updateAabbs()
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane.
int getNumChildShapes() const
const btCollisionWorld * m_world
btVector3 getHalfExtentsWithMargin() const
int getInternalType() const
reserved for Bullet internal usage
virtual btScalar addSingleResult(LocalConvexResult &convexResult, bool normalInWorldSpace)=0
virtual btScalar addSingleResult(LocalRayResult &rayResult, bool normalInWorldSpace)=0
The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y ...
class btStridingMeshInterface * getMeshInterface()
const btCollisionObjectWrapper * m_body1Wrap
const btConvexShape * m_castShape
const char * serialize(const class btPersistentManifold *manifold, void *dataBuffer, class btSerializer *serializer) const
bool isPolyhedral() const
#define WANTS_DEACTIVATION
The btCylinderShape class implements a cylinder shape primitive, centered around the origin....
btScalar m_closestHitFraction
const btManifoldPoint & getContactPoint(int index) const
CollisionWorld is interface and container for the collision detection.
virtual btScalar getMargin() const
virtual void serializeSingleObject(class btSerializer *serializer) const
bool getCustomDebugColor(btVector3 &colorRGB) const
btDispatcher * getDispatcher()
virtual int getNumEdges() const =0
virtual const btVector3 & getLocalScaling() const
virtual btOverlappingPairCache * getOverlappingPairCache()=0
btVector3 m_deactivatedObject
virtual DefaultColors getDefaultColors() const
void serializeCollisionObjects(btSerializer *serializer)
btBvhTriangleMeshShape * getChildShape()
virtual int getSerializationFlags() const =0
virtual void addCollisionObject(btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
RayResultCallback is used to report new raycast results.
bool m_forceUpdateAllAabbs
m_forceUpdateAllAabbs can be set to false as an optimization to only update active object AABBs it is...
btScalar gContactBreakingThreshold
btScalar m_allowedPenetration
void push_back(const T &_Val)
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size,...
RayResultCallback is used to report new raycast results.
void remove(const T &key)
btCollisionShape * getChildShape(int index)
virtual void cleanProxyFromPairs(btBroadphaseProxy *proxy, btDispatcher *dispatcher)=0
void performRaycast(btTriangleCallback *callback, const btVector3 &raySource, const btVector3 &rayTarget) const
Performs a raycast using a hierarchical Bresenham algorithm.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMesh...
btVector3 normalized() const
Return a normalized version of this vector.
virtual void internalProcessTriangleIndex(btVector3 *triangle, int partId, int triangleIndex)
btDispatcherInfo & getDispatchInfo()
virtual void aabbTest(const btVector3 &aabbMin, const btVector3 &aabbMax, btBroadphaseAabbCallback &callback)=0
virtual btChunk * allocate(size_t size, int numElements)=0
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 ...
const btDbvt * getDynamicAabbTree() const
virtual void drawAabb(const btVector3 &from, const btVector3 &to, const btVector3 &color)
btScalar m_closestPointDistanceThreshold
btScalar getRadius() const
void setActivationState(int newState) const
int size() const
return the number of elements in the array
bool btRayAabb(const btVector3 &rayFrom, const btVector3 &rayTo, const btVector3 &aabbMin, const btVector3 &aabbMax, btScalar ¶m, btVector3 &normal)
btCollisionWorld(btDispatcher *dispatcher, btBroadphaseInterface *broadphasePairCache, btCollisionConfiguration *collisionConfiguration)
for debug drawing
btVector3 m_rayDirectionInverse
added some cached data to accelerate ray-AABB tests
btScalar length2() const
Return the length of the vector squared.
virtual void serialize(btSerializer *serializer)
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bulle...
virtual btPersistentManifold * getManifoldByIndexInternal(int index)=0
const btCollisionShape * getCollisionShape() const
@ COMPOUND_SHAPE_PROXYTYPE
const btConvexPolyhedron * getConvexPolyhedron() const
virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform &transform, const btVector3 &color)