public CollisionDispatcher() { NearCallback = DefaultNearCallback; //_useIslands = true; //default CreationFunctions, filling the m_doubleDispatch table _convexConvexCreateFunc = new ConvexConvexAlgorithm.CreateFunc(); _convexConcaveCreateFunc = new ConvexConcaveCollisionAlgorithm.CreateFunc(); _swappedConvexConcaveCreateFunc = new ConvexConcaveCollisionAlgorithm.SwappedCreateFunc(); _compoundCreateFunc = new CompoundCollisionAlgorithm.CreateFunc(); _swappedCompoundCreateFunc = new CompoundCollisionAlgorithm.SwappedCreateFunc(); _emptyCreateFunc = new EmptyAlgorithm.CreateFunc(); for (BroadphaseNativeTypes i = BroadphaseNativeTypes.Box; i < BroadphaseNativeTypes.MaxBroadphaseCollisionTypes; i++) { for (BroadphaseNativeTypes j = BroadphaseNativeTypes.Box; j < BroadphaseNativeTypes.MaxBroadphaseCollisionTypes; j++) { _doubleDispatch[(int)i, (int)j] = FindCreateFunction(i, j); if (_doubleDispatch[(int)i, (int)j] == null) throw new BulletException(); } } }
public CollisionDispatcher() { NearCallback = DefaultNearCallback; //_useIslands = true; //default CreationFunctions, filling the m_doubleDispatch table _convexConvexCreateFunc = new ConvexConvexAlgorithm.CreateFunc(); _convexConcaveCreateFunc = new ConvexConcaveCollisionAlgorithm.CreateFunc(); _swappedConvexConcaveCreateFunc = new ConvexConcaveCollisionAlgorithm.SwappedCreateFunc(); _compoundCreateFunc = new CompoundCollisionAlgorithm.CreateFunc(); _swappedCompoundCreateFunc = new CompoundCollisionAlgorithm.SwappedCreateFunc(); _emptyCreateFunc = new EmptyAlgorithm.CreateFunc(); for (BroadphaseNativeTypes i = BroadphaseNativeTypes.Box; i < BroadphaseNativeTypes.MaxBroadphaseCollisionTypes; i++) { for (BroadphaseNativeTypes j = BroadphaseNativeTypes.Box; j < BroadphaseNativeTypes.MaxBroadphaseCollisionTypes; j++) { _doubleDispatch[(int)i, (int)j] = FindCreateFunction(i, j); if (_doubleDispatch[(int)i, (int)j] == null) { throw new BulletException(); } } } }
//registerCollisionCreateFunc allows registration of custom/alternative collision create functions public void RegisterCollisionCreateFunc(BroadphaseNativeTypes proxyTypeA, BroadphaseNativeTypes proxyTypeB, CollisionAlgorithmCreateFunction createFunc) { _doubleDispatch[(int)proxyTypeA, (int)proxyTypeB] = createFunc; }