Ejemplo n.º 1
0
        public CollisionDispatcher(ICollisionConfiguration collisionConfiguration)
        {
            m_collisionConfiguration = collisionConfiguration;
            m_dispatcherFlags = DispatcherFlags.CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD;
            SetNearCallback(new DefaultNearCallback());

            const int maxTypes = (int)BroadphaseNativeTypes.MAX_BROADPHASE_COLLISION_TYPES;
            m_doubleDispatch = new CollisionAlgorithmCreateFunc[maxTypes, maxTypes];
            for (int i = 0; i < maxTypes; i++)
            {
                for (int j = 0; j < maxTypes; j++)
                {
                    m_doubleDispatch[i, j] = m_collisionConfiguration.GetCollisionAlgorithmCreateFunc((BroadphaseNativeTypes)i, (BroadphaseNativeTypes)j);
                    Debug.Assert(m_doubleDispatch[i, j] != null);
                }
            }
        }
Ejemplo n.º 2
0
        public CollisionDispatcher(ICollisionConfiguration collisionConfiguration)
        {
            m_collisionConfiguration = collisionConfiguration;
            m_dispatcherFlags        = DispatcherFlags.CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD;
            SetNearCallback(new DefaultNearCallback());

            const int maxTypes = (int)BroadphaseNativeTypes.MAX_BROADPHASE_COLLISION_TYPES;

            m_doubleDispatch = new CollisionAlgorithmCreateFunc[maxTypes, maxTypes];
            for (int i = 0; i < maxTypes; i++)
            {
                for (int j = 0; j < maxTypes; j++)
                {
                    m_doubleDispatch[i, j] = m_collisionConfiguration.GetCollisionAlgorithmCreateFunc((BroadphaseNativeTypes)i, (BroadphaseNativeTypes)j);
                    // Debug.Assert(m_doubleDispatch[i, j] != null);
                }
            }
        }
Ejemplo n.º 3
0
 ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions
 public void RegisterCollisionCreateFunc(int proxyType0, int proxyType1, CollisionAlgorithmCreateFunc createFunc)
 {
     m_doubleDispatch[proxyType0, proxyType1] = createFunc;
 }
Ejemplo n.º 4
0
 ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions
 public void RegisterCollisionCreateFunc(int proxyType0, int proxyType1, CollisionAlgorithmCreateFunc createFunc)
 {
     m_doubleDispatch[proxyType0, proxyType1] = createFunc;
 }