Bullet Collision Detection & Physics Library: btDispatcher.h Source File

Bullet Collision Detection & Physics Library

btDispatcher.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef BT_DISPATCHER_H
17#define BT_DISPATCHER_H
18#include "LinearMath/btScalar.h"
19
20class btCollisionAlgorithm;
21struct btBroadphaseProxy;
22class btRigidBody;
23class btCollisionObject;
24class btOverlappingPairCache;
25struct btCollisionObjectWrapper;
26
27class btPersistentManifold;
28class btPoolAllocator;
29
30 struct btDispatcherInfo
31{
32 enum DispatchFunc
33 {
34 DISPATCH_DISCRETE = 1,
35 DISPATCH_CONTINUOUS
36 };
37 btDispatcherInfo()
38 : m_timeStep(btScalar(0.)),
39 m_stepCount(0),
40 m_dispatchFunc(DISPATCH_DISCRETE),
41 m_timeOfImpact(btScalar(1.)),
42 m_useContinuous(true),
43 m_debugDraw(0),
44 m_enableSatConvex(false),
45 m_enableSPU(true),
46 m_useEpa(true),
47 m_allowedCcdPenetration(btScalar(0.04)),
48 m_useConvexConservativeDistanceUtil(false),
49 m_convexConservativeDistanceThreshold(0.0f),
50 m_deterministicOverlappingPairs(false)
51 {
52 }
53 btScalar m_timeStep;
54 int m_stepCount;
55 int m_dispatchFunc;
56 mutable btScalar m_timeOfImpact;
57 bool m_useContinuous;
58 class btIDebugDraw* m_debugDraw;
59 bool m_enableSatConvex;
60 bool m_enableSPU;
61 bool m_useEpa;
62 btScalar m_allowedCcdPenetration;
63 bool m_useConvexConservativeDistanceUtil;
64 btScalar m_convexConservativeDistanceThreshold;
65 bool m_deterministicOverlappingPairs;
66};
67
68 enum ebtDispatcherQueryType
69{
70 BT_CONTACT_POINT_ALGORITHMS = 1,
71 BT_CLOSEST_POINT_ALGORITHMS = 2
72};
73
76 class btDispatcher
77{
78public:
79 virtual ~btDispatcher();
80
81 virtual btCollisionAlgorithm* findAlgorithm(const btCollisionObjectWrapper* body0Wrap, const btCollisionObjectWrapper* body1Wrap, btPersistentManifold* sharedManifold, ebtDispatcherQueryType queryType) = 0;
82
83 virtual btPersistentManifold* getNewManifold(const btCollisionObject* b0, const btCollisionObject* b1) = 0;
84
85 virtual void releaseManifold(btPersistentManifold* manifold) = 0;
86
87 virtual void clearManifold(btPersistentManifold* manifold) = 0;
88
89 virtual bool needsCollision(const btCollisionObject* body0, const btCollisionObject* body1) = 0;
90
91 virtual bool needsResponse(const btCollisionObject* body0, const btCollisionObject* body1) = 0;
92
93 virtual void dispatchAllCollisionPairs(btOverlappingPairCache* pairCache, const btDispatcherInfo& dispatchInfo, btDispatcher* dispatcher) = 0;
94
95 virtual int getNumManifolds() const = 0;
96
97 virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0;
98
99 virtual btPersistentManifold** getInternalManifoldPointer() = 0;
100
101 virtual btPoolAllocator* getInternalManifoldPool() = 0;
102
103 virtual const btPoolAllocator* getInternalManifoldPool() const = 0;
104
105 virtual void* allocateCollisionAlgorithm(int size) = 0;
106
107 virtual void freeCollisionAlgorithm(void* ptr) = 0;
108};
109
110#endif //BT_DISPATCHER_H
size
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
ebtDispatcherQueryType
ebtDispatcherQueryType
Definition btDispatcher.h:69
BT_CLOSEST_POINT_ALGORITHMS
@ BT_CLOSEST_POINT_ALGORITHMS
Definition btDispatcher.h:71
BT_CONTACT_POINT_ALGORITHMS
@ BT_CONTACT_POINT_ALGORITHMS
Definition btDispatcher.h:70
btScalar.h
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:314
btCollisionAlgorithm
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
Definition btCollisionAlgorithm.h:54
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition btCollisionObject.h:51
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition btDispatcher.h:77
btDispatcher::~btDispatcher
virtual ~btDispatcher()
Definition btDispatcher.cpp:18
btDispatcher::getNumManifolds
virtual int getNumManifolds() const =0
btDispatcher::getManifoldByIndexInternal
virtual btPersistentManifold * getManifoldByIndexInternal(int index)=0
btDispatcher::getInternalManifoldPool
virtual const btPoolAllocator * getInternalManifoldPool() const =0
btDispatcher::dispatchAllCollisionPairs
virtual void dispatchAllCollisionPairs(btOverlappingPairCache *pairCache, const btDispatcherInfo &dispatchInfo, btDispatcher *dispatcher)=0
btDispatcher::clearManifold
virtual void clearManifold(btPersistentManifold *manifold)=0
btDispatcher::allocateCollisionAlgorithm
virtual void * allocateCollisionAlgorithm(int size)=0
btDispatcher::releaseManifold
virtual void releaseManifold(btPersistentManifold *manifold)=0
btDispatcher::freeCollisionAlgorithm
virtual void freeCollisionAlgorithm(void *ptr)=0
btDispatcher::needsCollision
virtual bool needsCollision(const btCollisionObject *body0, const btCollisionObject *body1)=0
btDispatcher::needsResponse
virtual bool needsResponse(const btCollisionObject *body0, const btCollisionObject *body1)=0
btDispatcher::findAlgorithm
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
btDispatcher::getNewManifold
virtual btPersistentManifold * getNewManifold(const btCollisionObject *b0, const btCollisionObject *b1)=0
btDispatcher::getInternalManifoldPointer
virtual btPersistentManifold ** getInternalManifoldPointer()=0
btDispatcher::getInternalManifoldPool
virtual btPoolAllocator * getInternalManifoldPool()=0
btIDebugDraw
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
Definition btIDebugDraw.h:27
btOverlappingPairCache
The btOverlappingPairCache provides an interface for overlapping pair management (add,...
Definition btOverlappingPairCache.h:51
btPersistentManifold
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Definition btPersistentManifold.h:65
btPoolAllocator
The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamica...
Definition btPoolAllocator.h:24
btRigidBody
The btRigidBody is the main class for rigid body objects.
Definition btRigidBody.h:60
btBroadphaseProxy
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
Definition btBroadphaseProxy.h:86
btCollisionObjectWrapper
Definition btCollisionObjectWrapper.h:18
btDispatcherInfo
Definition btDispatcher.h:31
btDispatcherInfo::m_dispatchFunc
int m_dispatchFunc
Definition btDispatcher.h:55
btDispatcherInfo::DispatchFunc
DispatchFunc
Definition btDispatcher.h:33
btDispatcherInfo::DISPATCH_CONTINUOUS
@ DISPATCH_CONTINUOUS
Definition btDispatcher.h:35
btDispatcherInfo::DISPATCH_DISCRETE
@ DISPATCH_DISCRETE
Definition btDispatcher.h:34
btDispatcherInfo::m_timeStep
btScalar m_timeStep
Definition btDispatcher.h:53
btDispatcherInfo::m_allowedCcdPenetration
btScalar m_allowedCcdPenetration
Definition btDispatcher.h:62
btDispatcherInfo::m_deterministicOverlappingPairs
bool m_deterministicOverlappingPairs
Definition btDispatcher.h:65
btDispatcherInfo::m_useEpa
bool m_useEpa
Definition btDispatcher.h:61
btDispatcherInfo::m_enableSatConvex
bool m_enableSatConvex
Definition btDispatcher.h:59
btDispatcherInfo::m_useConvexConservativeDistanceUtil
bool m_useConvexConservativeDistanceUtil
Definition btDispatcher.h:63
btDispatcherInfo::btDispatcherInfo
btDispatcherInfo()
Definition btDispatcher.h:37
btDispatcherInfo::m_convexConservativeDistanceThreshold
btScalar m_convexConservativeDistanceThreshold
Definition btDispatcher.h:64
btDispatcherInfo::m_timeOfImpact
btScalar m_timeOfImpact
Definition btDispatcher.h:56
btDispatcherInfo::m_stepCount
int m_stepCount
Definition btDispatcher.h:54
btDispatcherInfo::m_useContinuous
bool m_useContinuous
Definition btDispatcher.h:57
btDispatcherInfo::m_enableSPU
bool m_enableSPU
Definition btDispatcher.h:60
btDispatcherInfo::m_debugDraw
class btIDebugDraw * m_debugDraw
Definition btDispatcher.h:58