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

Bullet Collision Detection & Physics Library

btDefaultCollisionConfiguration.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_DEFAULT_COLLISION_CONFIGURATION
17#define BT_DEFAULT_COLLISION_CONFIGURATION
18
19#include "btCollisionConfiguration.h"
20class btVoronoiSimplexSolver;
21class 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
46 class btDefaultCollisionConfiguration : public btCollisionConfiguration
47{
48protected:
49 int m_persistentManifoldPoolSize;
50
51 btPoolAllocator* m_persistentManifoldPool;
52 bool m_ownsPersistentManifoldPool;
53
54 btPoolAllocator* m_collisionAlgorithmPool;
55 bool m_ownsCollisionAlgorithmPool;
56
57 //default penetration depth solver
58 btConvexPenetrationDepthSolver* m_pdSolver;
59
60 //default CreationFunctions, filling the m_doubleDispatch table
61 btCollisionAlgorithmCreateFunc* m_convexConvexCreateFunc;
62 btCollisionAlgorithmCreateFunc* m_convexConcaveCreateFunc;
63 btCollisionAlgorithmCreateFunc* m_swappedConvexConcaveCreateFunc;
64 btCollisionAlgorithmCreateFunc* m_compoundCreateFunc;
65 btCollisionAlgorithmCreateFunc* m_compoundCompoundCreateFunc;
66
67 btCollisionAlgorithmCreateFunc* m_swappedCompoundCreateFunc;
68 btCollisionAlgorithmCreateFunc* m_emptyCreateFunc;
69 btCollisionAlgorithmCreateFunc* m_sphereSphereCF;
70 btCollisionAlgorithmCreateFunc* m_sphereBoxCF;
71 btCollisionAlgorithmCreateFunc* m_boxSphereCF;
72
73 btCollisionAlgorithmCreateFunc* m_boxBoxCF;
74 btCollisionAlgorithmCreateFunc* m_sphereTriangleCF;
75 btCollisionAlgorithmCreateFunc* m_triangleSphereCF;
76 btCollisionAlgorithmCreateFunc* m_planeConvexCF;
77 btCollisionAlgorithmCreateFunc* m_convexPlaneCF;
78
79public:
80 btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo& constructionInfo = btDefaultCollisionConstructionInfo());
81
82 virtual ~btDefaultCollisionConfiguration();
83
85 virtual btPoolAllocator* getPersistentManifoldPool()
86 {
87 return m_persistentManifoldPool;
88 }
89
90 virtual btPoolAllocator* getCollisionAlgorithmPool()
91 {
92 return m_collisionAlgorithmPool;
93 }
94
95 virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0, int proxyType1);
96
97 virtual btCollisionAlgorithmCreateFunc* getClosestPointsAlgorithmCreateFunc(int proxyType0, int proxyType1);
98
106 void setConvexConvexMultipointIterations(int numPerturbationIterations = 3, int minimumPointsPerturbationThreshold = 3);
107
108 void setPlaneConvexMultipointIterations(int numPerturbationIterations = 3, int minimumPointsPerturbationThreshold = 3);
109};
110
111#endif //BT_DEFAULT_COLLISION_CONFIGURATION
btCollisionConfiguration.h
btCollisionConfiguration
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size,...
Definition: btCollisionConfiguration.h:27
btConvexPenetrationDepthSolver
ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.
Definition: btConvexPenetrationDepthSolver.h:26
btDefaultCollisionConfiguration
btCollisionConfiguration allows to configure Bullet collision detection stack allocator,...
Definition: btDefaultCollisionConfiguration.h:47
btDefaultCollisionConfiguration::m_boxSphereCF
btCollisionAlgorithmCreateFunc * m_boxSphereCF
Definition: btDefaultCollisionConfiguration.h:71
btDefaultCollisionConfiguration::m_collisionAlgorithmPool
btPoolAllocator * m_collisionAlgorithmPool
Definition: btDefaultCollisionConfiguration.h:54
btDefaultCollisionConfiguration::m_compoundCreateFunc
btCollisionAlgorithmCreateFunc * m_compoundCreateFunc
Definition: btDefaultCollisionConfiguration.h:64
btDefaultCollisionConfiguration::m_triangleSphereCF
btCollisionAlgorithmCreateFunc * m_triangleSphereCF
Definition: btDefaultCollisionConfiguration.h:75
btDefaultCollisionConfiguration::setConvexConvexMultipointIterations
void setConvexConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold=3)
Use this method to allow to generate multiple contact points between at once, between two objects usi...
Definition: btDefaultCollisionConfiguration.cpp:346
btDefaultCollisionConfiguration::m_boxBoxCF
btCollisionAlgorithmCreateFunc * m_boxBoxCF
Definition: btDefaultCollisionConfiguration.h:73
btDefaultCollisionConfiguration::m_sphereTriangleCF
btCollisionAlgorithmCreateFunc * m_sphereTriangleCF
Definition: btDefaultCollisionConfiguration.h:74
btDefaultCollisionConfiguration::getClosestPointsAlgorithmCreateFunc
virtual btCollisionAlgorithmCreateFunc * getClosestPointsAlgorithmCreateFunc(int proxyType0, int proxyType1)
Definition: btDefaultCollisionConfiguration.cpp:193
btDefaultCollisionConfiguration::getPersistentManifoldPool
virtual btPoolAllocator * getPersistentManifoldPool()
memory pools
Definition: btDefaultCollisionConfiguration.h:85
btDefaultCollisionConfiguration::m_convexConcaveCreateFunc
btCollisionAlgorithmCreateFunc * m_convexConcaveCreateFunc
Definition: btDefaultCollisionConfiguration.h:62
btDefaultCollisionConfiguration::m_planeConvexCF
btCollisionAlgorithmCreateFunc * m_planeConvexCF
Definition: btDefaultCollisionConfiguration.h:76
btDefaultCollisionConfiguration::setPlaneConvexMultipointIterations
void setPlaneConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold=3)
Definition: btDefaultCollisionConfiguration.cpp:353
btDefaultCollisionConfiguration::m_compoundCompoundCreateFunc
btCollisionAlgorithmCreateFunc * m_compoundCompoundCreateFunc
Definition: btDefaultCollisionConfiguration.h:65
btDefaultCollisionConfiguration::m_pdSolver
btConvexPenetrationDepthSolver * m_pdSolver
Definition: btDefaultCollisionConfiguration.h:58
btDefaultCollisionConfiguration::m_persistentManifoldPool
btPoolAllocator * m_persistentManifoldPool
Definition: btDefaultCollisionConfiguration.h:51
btDefaultCollisionConfiguration::m_ownsPersistentManifoldPool
bool m_ownsPersistentManifoldPool
Definition: btDefaultCollisionConfiguration.h:52
btDefaultCollisionConfiguration::m_convexPlaneCF
btCollisionAlgorithmCreateFunc * m_convexPlaneCF
Definition: btDefaultCollisionConfiguration.h:77
btDefaultCollisionConfiguration::m_sphereSphereCF
btCollisionAlgorithmCreateFunc * m_sphereSphereCF
Definition: btDefaultCollisionConfiguration.h:69
btDefaultCollisionConfiguration::getCollisionAlgorithmCreateFunc
virtual btCollisionAlgorithmCreateFunc * getCollisionAlgorithmCreateFunc(int proxyType0, int proxyType1)
Definition: btDefaultCollisionConfiguration.cpp:267
btDefaultCollisionConfiguration::~btDefaultCollisionConfiguration
virtual ~btDefaultCollisionConfiguration()
Definition: btDefaultCollisionConfiguration.cpp:133
btDefaultCollisionConfiguration::m_persistentManifoldPoolSize
int m_persistentManifoldPoolSize
Definition: btDefaultCollisionConfiguration.h:49
btDefaultCollisionConfiguration::btDefaultCollisionConfiguration
btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo &constructionInfo=btDefaultCollisionConstructionInfo())
Definition: btDefaultCollisionConfiguration.cpp:37
btDefaultCollisionConfiguration::m_swappedConvexConcaveCreateFunc
btCollisionAlgorithmCreateFunc * m_swappedConvexConcaveCreateFunc
Definition: btDefaultCollisionConfiguration.h:63
btDefaultCollisionConfiguration::m_emptyCreateFunc
btCollisionAlgorithmCreateFunc * m_emptyCreateFunc
Definition: btDefaultCollisionConfiguration.h:68
btDefaultCollisionConfiguration::m_swappedCompoundCreateFunc
btCollisionAlgorithmCreateFunc * m_swappedCompoundCreateFunc
Definition: btDefaultCollisionConfiguration.h:67
btDefaultCollisionConfiguration::m_convexConvexCreateFunc
btCollisionAlgorithmCreateFunc * m_convexConvexCreateFunc
Definition: btDefaultCollisionConfiguration.h:61
btDefaultCollisionConfiguration::getCollisionAlgorithmPool
virtual btPoolAllocator * getCollisionAlgorithmPool()
Definition: btDefaultCollisionConfiguration.h:90
btDefaultCollisionConfiguration::m_sphereBoxCF
btCollisionAlgorithmCreateFunc * m_sphereBoxCF
Definition: btDefaultCollisionConfiguration.h:70
btDefaultCollisionConfiguration::m_ownsCollisionAlgorithmPool
bool m_ownsCollisionAlgorithmPool
Definition: btDefaultCollisionConfiguration.h:55
btPoolAllocator
The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamica...
Definition: btPoolAllocator.h:24
btVoronoiSimplexSolver
btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points...
Definition: btVoronoiSimplexSolver.h:99
btCollisionAlgorithmCreateFunc
Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm.
Definition: btCollisionCreateFunc.h:27
btDefaultCollisionConstructionInfo
Definition: btDefaultCollisionConfiguration.h:24
btDefaultCollisionConstructionInfo::btDefaultCollisionConstructionInfo
btDefaultCollisionConstructionInfo()
Definition: btDefaultCollisionConfiguration.h:32
btDefaultCollisionConstructionInfo::m_collisionAlgorithmPool
btPoolAllocator * m_collisionAlgorithmPool
Definition: btDefaultCollisionConfiguration.h:26
btDefaultCollisionConstructionInfo::m_defaultMaxCollisionAlgorithmPoolSize
int m_defaultMaxCollisionAlgorithmPoolSize
Definition: btDefaultCollisionConfiguration.h:28
btDefaultCollisionConstructionInfo::m_defaultMaxPersistentManifoldPoolSize
int m_defaultMaxPersistentManifoldPoolSize
Definition: btDefaultCollisionConfiguration.h:27
btDefaultCollisionConstructionInfo::m_persistentManifoldPool
btPoolAllocator * m_persistentManifoldPool
Definition: btDefaultCollisionConfiguration.h:25
btDefaultCollisionConstructionInfo::m_customCollisionAlgorithmMaxElementSize
int m_customCollisionAlgorithmMaxElementSize
Definition: btDefaultCollisionConfiguration.h:29
btDefaultCollisionConstructionInfo::m_useEpaPenetrationAlgorithm
int m_useEpaPenetrationAlgorithm
Definition: btDefaultCollisionConfiguration.h:30