Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef BT_DEFAULT_COLLISION_CONFIGURATION
00017 #define BT_DEFAULT_COLLISION_CONFIGURATION
00018
00019 #include "btCollisionConfiguration.h"
00020 class btVoronoiSimplexSolver;
00021 class btConvexPenetrationDepthSolver;
00022
00023 struct btDefaultCollisionConstructionInfo
00024 {
00025 btStackAlloc* m_stackAlloc;
00026 btPoolAllocator* m_persistentManifoldPool;
00027 btPoolAllocator* m_collisionAlgorithmPool;
00028 int m_defaultMaxPersistentManifoldPoolSize;
00029 int m_defaultMaxCollisionAlgorithmPoolSize;
00030 int m_customCollisionAlgorithmMaxElementSize;
00031 int m_defaultStackAllocatorSize;
00032 int m_useEpaPenetrationAlgorithm;
00033
00034 btDefaultCollisionConstructionInfo()
00035 :m_stackAlloc(0),
00036 m_persistentManifoldPool(0),
00037 m_collisionAlgorithmPool(0),
00038 m_defaultMaxPersistentManifoldPoolSize(4096),
00039 m_defaultMaxCollisionAlgorithmPoolSize(4096),
00040 m_customCollisionAlgorithmMaxElementSize(0),
00041 m_defaultStackAllocatorSize(0),
00042 m_useEpaPenetrationAlgorithm(true)
00043 {
00044 }
00045 };
00046
00047
00048
00052 class btDefaultCollisionConfiguration : public btCollisionConfiguration
00053 {
00054
00055 protected:
00056
00057 int m_persistentManifoldPoolSize;
00058
00059 btStackAlloc* m_stackAlloc;
00060 bool m_ownsStackAllocator;
00061
00062 btPoolAllocator* m_persistentManifoldPool;
00063 bool m_ownsPersistentManifoldPool;
00064
00065
00066 btPoolAllocator* m_collisionAlgorithmPool;
00067 bool m_ownsCollisionAlgorithmPool;
00068
00069
00070 btVoronoiSimplexSolver* m_simplexSolver;
00071 btConvexPenetrationDepthSolver* m_pdSolver;
00072
00073
00074 btCollisionAlgorithmCreateFunc* m_convexConvexCreateFunc;
00075 btCollisionAlgorithmCreateFunc* m_convexConcaveCreateFunc;
00076 btCollisionAlgorithmCreateFunc* m_swappedConvexConcaveCreateFunc;
00077 btCollisionAlgorithmCreateFunc* m_compoundCreateFunc;
00078 btCollisionAlgorithmCreateFunc* m_swappedCompoundCreateFunc;
00079 btCollisionAlgorithmCreateFunc* m_emptyCreateFunc;
00080 btCollisionAlgorithmCreateFunc* m_sphereSphereCF;
00081 #ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
00082 btCollisionAlgorithmCreateFunc* m_sphereBoxCF;
00083 btCollisionAlgorithmCreateFunc* m_boxSphereCF;
00084 #endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
00085
00086 btCollisionAlgorithmCreateFunc* m_boxBoxCF;
00087 btCollisionAlgorithmCreateFunc* m_sphereTriangleCF;
00088 btCollisionAlgorithmCreateFunc* m_triangleSphereCF;
00089 btCollisionAlgorithmCreateFunc* m_planeConvexCF;
00090 btCollisionAlgorithmCreateFunc* m_convexPlaneCF;
00091
00092 public:
00093
00094
00095 btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo& constructionInfo = btDefaultCollisionConstructionInfo());
00096
00097 virtual ~btDefaultCollisionConfiguration();
00098
00100 virtual btPoolAllocator* getPersistentManifoldPool()
00101 {
00102 return m_persistentManifoldPool;
00103 }
00104
00105 virtual btPoolAllocator* getCollisionAlgorithmPool()
00106 {
00107 return m_collisionAlgorithmPool;
00108 }
00109
00110 virtual btStackAlloc* getStackAllocator()
00111 {
00112 return m_stackAlloc;
00113 }
00114
00115 virtual btVoronoiSimplexSolver* getSimplexSolver()
00116 {
00117 return m_simplexSolver;
00118 }
00119
00120
00121 virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1);
00122
00130 void setConvexConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold = 3);
00131
00132 void setPlaneConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold = 3);
00133
00134 };
00135
00136 #endif //BT_DEFAULT_COLLISION_CONFIGURATION
00137