// pass null to use default construction info
		public btDefaultCollisionConfiguration( btDefaultCollisionConstructionInfo constructionInfo )
		//btDefaultCollisionConfiguration(btStackAlloc*	stackAlloc,btPoolAllocator*	persistentManifoldPool,btPoolAllocator*	collisionAlgorithmPool)
		{
			if( constructionInfo == null )
				constructionInfo = new btDefaultCollisionConstructionInfo();

			m_simplexSolver = BulletGlobals.VoronoiSimplexSolverPool.Get();

#if !REMOVE_OBSOLETE_SOLVER
			if( constructionInfo.m_useEpaPenetrationAlgorithm )
#endif
			{
				m_pdSolver = BulletGlobals.GjkEpaPenetrationDepthSolverPool.Get();
			}
#if !REMOVE_OBSOLETE_SOLVER
			else
			{
				mem = btAlignedAlloc( sizeof( btMinkowskiPenetrationDepthSolver ), 16 );
				m_pdSolver = 
					new btMinkowskiPenetrationDepthSolver;
			}
#endif

			//default CreationFunctions, filling the m_doubleDispatch table
			m_convexConvexCreateFunc = new btConvexConvexAlgorithm.CreateFunc( m_simplexSolver, m_pdSolver );
			m_convexConcaveCreateFunc = new btConvexConcaveCollisionAlgorithm.CreateFunc();
			m_swappedConvexConcaveCreateFunc = new btConvexConcaveCollisionAlgorithm.SwappedCreateFunc();
			m_compoundCreateFunc = new btCompoundCollisionAlgorithm.CreateFunc();

			m_compoundCompoundCreateFunc = new btCompoundCompoundCollisionAlgorithm.CreateFunc();

			m_swappedCompoundCreateFunc = new btCompoundCollisionAlgorithm.SwappedCreateFunc();
			m_emptyCreateFunc = new btEmptyAlgorithm.CreateFunc();

			m_sphereSphereCF = new btSphereSphereCollisionAlgorithm.CreateFunc();
#if USE_BUGGY_SPHERE_BOX_ALGORITHM
			m_sphereBoxCF = new(mem) btSphereBoxCollisionAlgorithm.CreateFunc;
			m_boxSphereCF = new (mem)btSphereBoxCollisionAlgorithm.CreateFunc;
			m_boxSphereCF.m_swapped = true;
#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM

			m_sphereTriangleCF = new btSphereTriangleCollisionAlgorithm.CreateFunc();
			m_triangleSphereCF = new btSphereTriangleCollisionAlgorithm.CreateFunc();
			m_triangleSphereCF.m_swapped = true;

			m_boxBoxCF = new btBoxBoxCollisionAlgorithm.CreateFunc();

			//convex versus plane
			m_convexPlaneCF = new  btConvexPlaneCollisionAlgorithm.CreateFunc();
			m_planeConvexCF = new  btConvexPlaneCollisionAlgorithm.CreateFunc();
			m_planeConvexCF.m_swapped = true;

			///calculate maximum element size, big enough to fit any collision algorithm in the memory pool
			/*
			int maxSize = sizeof( btConvexConvexAlgorithm );
			int maxSize2 = sizeof( btConvexConcaveCollisionAlgorithm );
			int maxSize3 = sizeof( btCompoundCollisionAlgorithm );
			int maxSize4 = sizeof( btCompoundCompoundCollisionAlgorithm );

			int collisionAlgorithmMaxElementSize = btScalar.btMax( maxSize, constructionInfo.m_customCollisionAlgorithmMaxElementSize );
			collisionAlgorithmMaxElementSize = btScalar.btMax( collisionAlgorithmMaxElementSize, maxSize2 );
			collisionAlgorithmMaxElementSize = btScalar.btMax( collisionAlgorithmMaxElementSize, maxSize3 );
			collisionAlgorithmMaxElementSize = btScalar.btMax( collisionAlgorithmMaxElementSize, maxSize4 );
			*/

			/*
			if( constructionInfo.m_persistentManifoldPool )
			{
				m_ownsPersistentManifoldPool = false;
				m_persistentManifoldPool = constructionInfo.m_persistentManifoldPool;
			}
			else
			{
				m_ownsPersistentManifoldPool = true;
				object mem = btAlignedAlloc( sizeof( btPoolAllocator ), 16 );
				m_persistentManifoldPool = new  btPoolAllocator( sizeof( btPersistentManifold ), constructionInfo.m_defaultMaxPersistentManifoldPoolSize );
			}

			if( constructionInfo.m_collisionAlgorithmPool )
			{
				m_ownsCollisionAlgorithmPool = false;
				m_collisionAlgorithmPool = constructionInfo.m_collisionAlgorithmPool;
			}
			else
			{
				m_ownsCollisionAlgorithmPool = true;
				object mem = btAlignedAlloc( sizeof( btPoolAllocator ), 16 );
				m_collisionAlgorithmPool = new btPoolAllocator( collisionAlgorithmMaxElementSize, constructionInfo.m_defaultMaxCollisionAlgorithmPoolSize );
			}
			*/

		}
示例#2
0
		void registerCollisionCreateFunc( int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc createFunc )
		{
			m_doubleDispatch[proxyType0, proxyType1] = createFunc;
		}