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

Bullet Collision Detection & Physics Library

btDefaultCollisionConfiguration.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10
11 1. 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.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
16 #ifndef BT_DEFAULT_COLLISION_CONFIGURATION
17 #define BT_DEFAULT_COLLISION_CONFIGURATION
18
19 #include "btCollisionConfiguration.h"
20 class btVoronoiSimplexSolver;
21 class btConvexPenetrationDepthSolver;
22
23 struct btDefaultCollisionConstructionInfo
24 {
25 btPoolAllocator* m_persistentManifoldPool;
26 btPoolAllocator* m_collisionAlgorithmPool;
27 int m_defaultMaxPersistentManifoldPoolSize;
28 int m_defaultMaxCollisionAlgorithmPoolSize;
29 int m_customCollisionAlgorithmMaxElementSize;
30 int m_useEpaPenetrationAlgorithm;
31
32 btDefaultCollisionConstructionInfo()
33 :m_persistentManifoldPool(0),
34 m_collisionAlgorithmPool(0),
35 m_defaultMaxPersistentManifoldPoolSize(4096),
36 m_defaultMaxCollisionAlgorithmPoolSize(4096),
37 m_customCollisionAlgorithmMaxElementSize(0),
38 m_useEpaPenetrationAlgorithm(true)
39 {
40 }
41 };
42
43
44
48 class btDefaultCollisionConfiguration : public btCollisionConfiguration
49 {
50
51 protected:
52
53 int m_persistentManifoldPoolSize;
54
55
56 btPoolAllocator* m_persistentManifoldPool;
57 bool m_ownsPersistentManifoldPool;
58
59
60 btPoolAllocator* m_collisionAlgorithmPool;
61 bool m_ownsCollisionAlgorithmPool;
62
63 //default penetration depth solver
64 btConvexPenetrationDepthSolver* m_pdSolver;
65
66 //default CreationFunctions, filling the m_doubleDispatch table
67 btCollisionAlgorithmCreateFunc* m_convexConvexCreateFunc;
68 btCollisionAlgorithmCreateFunc* m_convexConcaveCreateFunc;
69 btCollisionAlgorithmCreateFunc* m_swappedConvexConcaveCreateFunc;
70 btCollisionAlgorithmCreateFunc* m_compoundCreateFunc;
71 btCollisionAlgorithmCreateFunc* m_compoundCompoundCreateFunc;
72
73 btCollisionAlgorithmCreateFunc* m_swappedCompoundCreateFunc;
74 btCollisionAlgorithmCreateFunc* m_emptyCreateFunc;
75 btCollisionAlgorithmCreateFunc* m_sphereSphereCF;
76 btCollisionAlgorithmCreateFunc* m_sphereBoxCF;
77 btCollisionAlgorithmCreateFunc* m_boxSphereCF;
78
79 btCollisionAlgorithmCreateFunc* m_boxBoxCF;
80 btCollisionAlgorithmCreateFunc* m_sphereTriangleCF;
81 btCollisionAlgorithmCreateFunc* m_triangleSphereCF;
82 btCollisionAlgorithmCreateFunc* m_planeConvexCF;
83 btCollisionAlgorithmCreateFunc* m_convexPlaneCF;
84
85 public:
86
87
88 btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo& constructionInfo = btDefaultCollisionConstructionInfo());
89
90 virtual ~btDefaultCollisionConfiguration();
91
93 virtual btPoolAllocator* getPersistentManifoldPool()
94 {
95 return m_persistentManifoldPool;
96 }
97
98 virtual btPoolAllocator* getCollisionAlgorithmPool()
99 {
100 return m_collisionAlgorithmPool;
101 }
102
103
104 virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1);
105
106 virtual btCollisionAlgorithmCreateFunc* getClosestPointsAlgorithmCreateFunc(int proxyType0, int proxyType1);
107
115 void setConvexConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold = 3);
116
117 void setPlaneConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold = 3);
118
119 };
120
121 #endif //BT_DEFAULT_COLLISION_CONFIGURATION
122
btDefaultCollisionConfiguration::m_convexPlaneCF
btCollisionAlgorithmCreateFunc * m_convexPlaneCF
Definition: btDefaultCollisionConfiguration.h:83
btDefaultCollisionConstructionInfo::m_persistentManifoldPool
btPoolAllocator * m_persistentManifoldPool
Definition: btDefaultCollisionConfiguration.h:25
btDefaultCollisionConfiguration::m_ownsCollisionAlgorithmPool
bool m_ownsCollisionAlgorithmPool
Definition: btDefaultCollisionConfiguration.h:61
btConvexPenetrationDepthSolver
ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.
Definition: btConvexPenetrationDepthSolver.h:26
btCollisionConfiguration
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size...
Definition: btCollisionConfiguration.h:26
btDefaultCollisionConfiguration::m_collisionAlgorithmPool
btPoolAllocator * m_collisionAlgorithmPool
Definition: btDefaultCollisionConfiguration.h:60
btDefaultCollisionConfiguration::m_pdSolver
btConvexPenetrationDepthSolver * m_pdSolver
Definition: btDefaultCollisionConfiguration.h:64
btDefaultCollisionConstructionInfo
Definition: btDefaultCollisionConfiguration.h:23
btDefaultCollisionConstructionInfo::m_customCollisionAlgorithmMaxElementSize
int m_customCollisionAlgorithmMaxElementSize
Definition: btDefaultCollisionConfiguration.h:29
btDefaultCollisionConstructionInfo::m_collisionAlgorithmPool
btPoolAllocator * m_collisionAlgorithmPool
Definition: btDefaultCollisionConfiguration.h:26
btDefaultCollisionConfiguration::m_persistentManifoldPoolSize
int m_persistentManifoldPoolSize
Definition: btDefaultCollisionConfiguration.h:53
btDefaultCollisionConfiguration::m_boxBoxCF
btCollisionAlgorithmCreateFunc * m_boxBoxCF
Definition: btDefaultCollisionConfiguration.h:79
btDefaultCollisionConfiguration::m_triangleSphereCF
btCollisionAlgorithmCreateFunc * m_triangleSphereCF
Definition: btDefaultCollisionConfiguration.h:81
btDefaultCollisionConfiguration::m_ownsPersistentManifoldPool
bool m_ownsPersistentManifoldPool
Definition: btDefaultCollisionConfiguration.h:57
btDefaultCollisionConstructionInfo::m_defaultMaxCollisionAlgorithmPoolSize
int m_defaultMaxCollisionAlgorithmPoolSize
Definition: btDefaultCollisionConfiguration.h:28
btDefaultCollisionConfiguration
btCollisionConfiguration allows to configure Bullet collision detection stack allocator, pool memory allocators
Definition: btDefaultCollisionConfiguration.h:48
btVoronoiSimplexSolver
btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points...
Definition: btVoronoiSimplexSolver.h:99
btDefaultCollisionConfiguration::m_swappedConvexConcaveCreateFunc
btCollisionAlgorithmCreateFunc * m_swappedConvexConcaveCreateFunc
Definition: btDefaultCollisionConfiguration.h:69
btDefaultCollisionConfiguration::getCollisionAlgorithmPool
virtual btPoolAllocator * getCollisionAlgorithmPool()
Definition: btDefaultCollisionConfiguration.h:98
btCollisionAlgorithmCreateFunc
Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm.
Definition: btCollisionCreateFunc.h:26
btCollisionConfiguration.h
btDefaultCollisionConstructionInfo::m_useEpaPenetrationAlgorithm
int m_useEpaPenetrationAlgorithm
Definition: btDefaultCollisionConfiguration.h:30
btDefaultCollisionConfiguration::m_persistentManifoldPool
btPoolAllocator * m_persistentManifoldPool
Definition: btDefaultCollisionConfiguration.h:56
btDefaultCollisionConfiguration::m_emptyCreateFunc
btCollisionAlgorithmCreateFunc * m_emptyCreateFunc
Definition: btDefaultCollisionConfiguration.h:74
btDefaultCollisionConfiguration::m_sphereTriangleCF
btCollisionAlgorithmCreateFunc * m_sphereTriangleCF
Definition: btDefaultCollisionConfiguration.h:80
btDefaultCollisionConfiguration::m_sphereSphereCF
btCollisionAlgorithmCreateFunc * m_sphereSphereCF
Definition: btDefaultCollisionConfiguration.h:75
btDefaultCollisionConfiguration::m_planeConvexCF
btCollisionAlgorithmCreateFunc * m_planeConvexCF
Definition: btDefaultCollisionConfiguration.h:82
btDefaultCollisionConfiguration::m_compoundCreateFunc
btCollisionAlgorithmCreateFunc * m_compoundCreateFunc
Definition: btDefaultCollisionConfiguration.h:70
btPoolAllocator
The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamica...
Definition: btPoolAllocator.h:24
btDefaultCollisionConstructionInfo::btDefaultCollisionConstructionInfo
btDefaultCollisionConstructionInfo()
Definition: btDefaultCollisionConfiguration.h:32
btDefaultCollisionConfiguration::m_boxSphereCF
btCollisionAlgorithmCreateFunc * m_boxSphereCF
Definition: btDefaultCollisionConfiguration.h:77
btDefaultCollisionConfiguration::m_compoundCompoundCreateFunc
btCollisionAlgorithmCreateFunc * m_compoundCompoundCreateFunc
Definition: btDefaultCollisionConfiguration.h:71
btDefaultCollisionConfiguration::m_convexConcaveCreateFunc
btCollisionAlgorithmCreateFunc * m_convexConcaveCreateFunc
Definition: btDefaultCollisionConfiguration.h:68
btDefaultCollisionConstructionInfo::m_defaultMaxPersistentManifoldPoolSize
int m_defaultMaxPersistentManifoldPoolSize
Definition: btDefaultCollisionConfiguration.h:27
btDefaultCollisionConfiguration::m_sphereBoxCF
btCollisionAlgorithmCreateFunc * m_sphereBoxCF
Definition: btDefaultCollisionConfiguration.h:76
btDefaultCollisionConfiguration::getPersistentManifoldPool
virtual btPoolAllocator * getPersistentManifoldPool()
memory pools
Definition: btDefaultCollisionConfiguration.h:93
btDefaultCollisionConfiguration::m_convexConvexCreateFunc
btCollisionAlgorithmCreateFunc * m_convexConvexCreateFunc
Definition: btDefaultCollisionConfiguration.h:67
btDefaultCollisionConfiguration::m_swappedCompoundCreateFunc
btCollisionAlgorithmCreateFunc * m_swappedCompoundCreateFunc
Definition: btDefaultCollisionConfiguration.h:73