71 m_forceUpdateAllAabbs(
true)
222 BT_PROFILE(
"performDiscreteCollisionDetection");
327#ifdef USE_SUBSIMPLEX_CONVEX_CAST
558 rayTestSingleInternal(
581#ifndef DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
591 for (
int i = 0, n =
compoundShape->getNumChildShapes(); i < n; ++i)
593 rayCB.ProcessLeaf(i);
878 objectQuerySingleInternal(m_castShape, m_convexFromTrans, m_convexToTrans, &
tmpObj,
my_cb, m_allowedPenetration);
979#ifdef RECALCULATE_AABB
1010#ifndef USE_BRUTEFORCE_RAYBROADPHASE
1098#ifndef USE_BRUTEFORCE_RAYBROADPHASE
1311 for (
int i =
compoundShape->getNumChildShapes() - 1; i >= 0; i--)
1403 for (i = 0; i <
poly->m_faces.size(); i++)
1410 for (
int v = 0; v <
poly->m_faces[i].m_indices.size(); v++)
1429 for (i = 0; i <
polyshape->getNumEdges(); i++)
1510 switch (
colObj->getActivationState())
1605 if (
manifold->getNumContacts() == 0)
bool btRayAabb(const btVector3 &rayFrom, const btVector3 &rayTo, const btVector3 &aabbMin, const btVector3 &aabbMax, btScalar ¶m, btVector3 &normal)
void AabbExpand(btVector3 &aabbMin, btVector3 &aabbMax, const btVector3 &expansionMin, const btVector3 &expansionMax)
@ CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE
@ COMPOUND_SHAPE_PROXYTYPE
@ SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE
@ TRIANGLE_MESH_SHAPE_PROXYTYPE
@ TERRAIN_SHAPE_PROXYTYPE
@ MULTI_SPHERE_SHAPE_PROXYTYPE
@ CYLINDER_SHAPE_PROXYTYPE
@ CAPSULE_SHAPE_PROXYTYPE
#define DISABLE_DEACTIVATION
#define WANTS_DEACTIVATION
#define DISABLE_SIMULATION
btScalar gContactBreakingThreshold
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
@ BT_CLOSEST_POINT_ALGORITHMS
const T & btMax(const T &a, const T &b)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
@ BT_SERIALIZE_CONTACT_MANIFOLDS
#define BT_CONTACTMANIFOLD_CODE
virtual void internalProcessTriangleIndex(btVector3 *triangle, int partId, int triangleIndex)
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
DebugDrawcallback(btIDebugDraw *debugDrawer, const btTransform &worldTrans, const btVector3 &color)
btIDebugDraw * m_debugDrawer
int size() const
return the number of elements in the array
int findLinearSearch(const T &key) const
void swap(int index0, int index1)
void remove(const T &key)
void push_back(const T &_Val)
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
virtual void aabbTest(const btVector3 &aabbMin, const btVector3 &aabbMax, btBroadphaseAabbCallback &callback)=0
virtual void calculateOverlappingPairs(btDispatcher *dispatcher)=0
calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during th...
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
virtual void setAabb(btBroadphaseProxy *proxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher)=0
virtual void destroyProxy(btBroadphaseProxy *proxy, btDispatcher *dispatcher)=0
virtual btOverlappingPairCache * getOverlappingPairCache()=0
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
btScalar getRadius() const
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
virtual ~btCollisionAlgorithm()
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size,...
btCollisionObject can be used to manage collision detection objects.
@ CF_DISABLE_VISUALIZE_OBJECT
btTransform & getWorldTransform()
const btCollisionShape * getCollisionShape() const
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
virtual void serializeSingleShape(btSerializer *serializer) const
bool isPolyhedral() const
CollisionWorld is interface and container for the collision detection.
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 ...
virtual void updateAabbs()
btDispatcher * getDispatcher()
btDispatcherInfo & getDispatchInfo()
virtual void serialize(btSerializer *serializer)
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bulle...
virtual void debugDrawWorld()
static void objectQuerySingleInternal(const btConvexShape *castShape, const btTransform &convexFromTrans, const btTransform &convexToTrans, const btCollisionObjectWrapper *colObjWrap, ConvexResultCallback &resultCallback, btScalar allowedPenetration)
virtual btIDebugDraw * getDebugDrawer()
virtual ~btCollisionWorld()
virtual void refreshBroadphaseProxy(btCollisionObject *collisionObject)
btBroadphaseInterface * m_broadphasePairCache
void updateSingleAabb(btCollisionObject *colObj)
virtual void removeCollisionObject(btCollisionObject *collisionObject)
virtual void addCollisionObject(btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
btAlignedObjectArray< btCollisionObject * > m_collisionObjects
btCollisionWorld(btDispatcher *dispatcher, btBroadphaseInterface *broadphasePairCache, btCollisionConfiguration *collisionConfiguration)
for debug drawing
int getNumCollisionObjects() const
virtual void performDiscreteCollisionDetection()
static void rayTestSingleInternal(const btTransform &rayFromTrans, const btTransform &rayToTrans, const btCollisionObjectWrapper *collisionObjectWrap, RayResultCallback &resultCallback)
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...
bool m_forceUpdateAllAabbs
m_forceUpdateAllAabbs can be set to false as an optimization to only update active object AABBs it is...
btIDebugDraw * m_debugDrawer
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....
btDispatcher * m_dispatcher1
void contactPairTest(btCollisionObject *colObjA, btCollisionObject *colObjB, ContactResultCallback &resultCallback)
contactTest performs a discrete collision test between two collision objects and calls the resultCall...
void serializeContactManifolds(btSerializer *serializer)
virtual void debugDrawObject(const btTransform &worldTransform, const btCollisionShape *shape, const btVector3 &color)
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.
const btBroadphaseInterface * getBroadphase() const
void contactTest(btCollisionObject *colObj, ContactResultCallback &resultCallback)
contactTest performs a discrete collision test between colObj against all objects in the btCollisionW...
void serializeCollisionObjects(btSerializer *serializer)
virtual void computeOverlappingPairs()
the computeOverlappingPairs is usually already called by performDiscreteCollisionDetection (or stepSi...
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
btCollisionShape * getChildShape(int index)
btTransform & getChildTransform(int index)
The btConcaveShape class provides an interface for non-moving (static) concave shapes.
The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y ...
btScalar getRadius() const
btContinuousConvexCollision implements angular and linear time of impact for convex objects.
Typically the conservative advancement reaches solution in a few iterations, clip it to 32 for degene...
The btConvexShape is an abstract shape interface, implemented by all convex shapes such as btBoxShape...
The btConvexTriangleMeshShape is a convex hull of a triangle mesh, but the performance is not as good...
The btCylinderShape class implements a cylinder shape primitive, centered around the origin....
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
virtual int getNumManifolds() const =0
virtual btPersistentManifold * getManifoldByIndexInternal(int index)=0
virtual void freeCollisionAlgorithm(void *ptr)=0
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
virtual btPersistentManifold ** getInternalManifoldPointer()=0
GjkConvexCast performs a raycast on a convex object using support mapping.
EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to calculate the penetration depth be...
The btHashMap template class implements a generic and lightweight hashmap.
btHeightfieldTerrainShape simulates a 2D heightfield terrain
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform &transform, const btVector3 &color)
virtual void drawPlane(const btVector3 &planeNormal, btScalar planeConst, const btTransform &transform, const btVector3 &color)
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
virtual void drawSphere(btScalar radius, const btTransform &transform, const btVector3 &color)
virtual void drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &, const btVector3 &, const btVector3 &, const btVector3 &color, btScalar alpha)
virtual void reportErrorWarning(const char *warningString)=0
virtual void clearLines()
virtual void drawTransform(const btTransform &transform, btScalar orthoLen)
virtual void drawContactPoint(const btVector3 &PointOnB, const btVector3 &normalOnB, btScalar distance, int lifeTime, const btVector3 &color)=0
virtual int getDebugMode() const =0
virtual void drawBox(const btVector3 &bbMin, const btVector3 &bbMax, const btVector3 &color)
virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
virtual DefaultColors getDefaultColors() const
virtual void drawAabb(const btVector3 &from, const btVector3 &to, const btVector3 &color)
virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
ManifoldContactPoint collects and maintains persistent contactpoints.
btManifoldResult is a helper class to manage contact results.
const btCollisionObjectWrapper * m_body0Wrap
const btCollisionObjectWrapper * m_body1Wrap
btPersistentManifold * m_manifoldPtr
The btMultiSphereShape represents the convex hull of a collection of spheres.
virtual void cleanProxyFromPairs(btBroadphaseProxy *proxy, btDispatcher *dispatcher)=0
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
const btCollisionObject * getBody0() const
int getNumContacts() const
The btPolyhedralConvexShape is an internal interface class for polyhedral convex shapes.
The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMesh...
The btSphereShape implements an implicit sphere, centered around a local origin with radius.
virtual btScalar getMargin() const
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane.
const btScalar & getPlaneConstant() const
btSubsimplexConvexCast implements Gino van den Bergens' paper "Ray Casting against bteral Convex Obje...
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
The btTriangleMeshShape is an internal concave triangle mesh interface. Don't use this class directly...
@ kF_DisableHeightfieldAccelerator
@ kF_UseGjkConvexCastRaytest
btVector3 can be used to represent 3D points and vectors.
void setMax(const btVector3 &other)
Set each element to the max of the current values and the values of another btVector3.
btScalar dot(const btVector3 &v) const
Return the dot product.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
void setMin(const btVector3 &other)
Set each element to the min of the current values and the values of another btVector3.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points...
btCollisionWorld::ContactResultCallback & m_resultCallback
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)
btBridgedManifoldResult(const btCollisionObjectWrapper *obj0Wrap, const btCollisionObjectWrapper *obj1Wrap, btCollisionWorld::ContactResultCallback &resultCallback)
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
btVector3 m_rayDirectionInverse
added some cached data to accelerate ray-AABB tests
const btCollisionObject * getCollisionObject() const
RayResultCallback is used to report new raycast results.
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
btScalar m_closestHitFraction
virtual btScalar addSingleResult(LocalConvexResult &convexResult, bool normalInWorldSpace)=0
LocalShapeInfo * m_localShapeInfo
LocalShapeInfo * m_localShapeInfo
LocalShapeInfo gives extra information for complex shapes Currently, only btTriangleMeshShape is avai...
RayResultCallback is used to report new raycast results.
btScalar m_closestHitFraction
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
virtual btScalar addSingleResult(LocalRayResult &rayResult, bool normalInWorldSpace)=0
RayResult stores the closest result alternatively, add a callback method to decide about closest/all ...
btScalar m_allowedPenetration
static btDbvtAabbMm FromMM(const btVector3 &mi, const btVector3 &mx)
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes ...
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...
const btCollisionWorld * m_world
btTransform m_rayFromTrans
virtual bool process(const btBroadphaseProxy *proxy)
btSingleRayCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const btCollisionWorld *world, btCollisionWorld::RayResultCallback &resultCallback)
btCollisionWorld::RayResultCallback & m_resultCallback
const btConvexShape * m_castShape
btTransform m_convexToTrans
virtual bool process(const btBroadphaseProxy *proxy)
const btCollisionWorld * m_world
btTransform m_convexFromTrans
btCollisionWorld::ConvexResultCallback & m_resultCallback
btScalar m_allowedCcdPenetration
btSingleSweepCallback(const btConvexShape *castShape, const btTransform &convexFromTrans, const btTransform &convexToTrans, const btCollisionWorld *world, btCollisionWorld::ConvexResultCallback &resultCallback, btScalar allowedPenetration)