public override CollisionAlgorithmCreateFunc GetCollisionAlgorithmCreateFunc(BroadphaseNativeType proxyType0, BroadphaseNativeType proxyType1) { IntPtr createFunc = btCollisionConfiguration_getCollisionAlgorithmCreateFunc(_native, (int)proxyType0, (int)proxyType1); if (proxyType0 == BroadphaseNativeType.SoftBodyShape && proxyType1 == BroadphaseNativeType.SoftBodyShape) { return new SoftSoftCollisionAlgorithm.CreateFunc(createFunc); } if (proxyType0 == BroadphaseNativeType.SoftBodyShape && BroadphaseProxy.IsConvex(proxyType1)) { return new SoftRigidCollisionAlgorithm.CreateFunc(createFunc); } if (BroadphaseProxy.IsConvex(proxyType0) && proxyType1 == BroadphaseNativeType.SoftBodyShape) { return new SoftRigidCollisionAlgorithm.CreateFunc(createFunc); } if (proxyType0 == BroadphaseNativeType.SoftBodyShape && BroadphaseProxy.IsConcave(proxyType1)) { return new SoftBodyConcaveCollisionAlgorithm.CreateFunc(createFunc); } if (BroadphaseProxy.IsConcave(proxyType0) && proxyType1 == BroadphaseNativeType.SoftBodyShape) { return new SoftBodyConcaveCollisionAlgorithm.SwappedCreateFunc(createFunc); } return base.GetCollisionAlgorithmCreateFunc(proxyType0, proxyType1); }
public void RegisterCollisionCreateFunc(BroadphaseNativeType proxyType0, BroadphaseNativeType proxyType1, CollisionAlgorithmCreateFunc createFunc) { if (_collisionCreateFuncs == null) { _collisionCreateFuncs = new List<CollisionAlgorithmCreateFunc>(); } _collisionCreateFuncs.Add(createFunc); btCollisionDispatcher_registerCollisionCreateFunc(_native, proxyType0, proxyType1, createFunc._native); }
public static bool IsInfinite(BroadphaseNativeType proxyType) { return(btBroadphaseProxy_isInfinite(proxyType)); }
public override CollisionAlgorithm getCollisionAlgorithmCreateFunc(BroadphaseNativeType proxyType0, BroadphaseNativeType proxyType1) { if ((proxyType0 == BroadphaseNativeType.SPHERE_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.SPHERE_SHAPE_PROXYTYPE)) { return(sphereSphereCF); } if ((proxyType0 == BroadphaseNativeType.SPHERE_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.CAPSULE_SHAPE_PROXYTYPE)) { return(sphereCapsuleCF); } if ((proxyType0 == BroadphaseNativeType.CAPSULE_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.SPHERE_SHAPE_PROXYTYPE)) { return(sphereCapsuleCF); } if ((proxyType0 == BroadphaseNativeType.SPHERE_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.BOX_SHAPE_PROXYTYPE)) { return(sphereBoxCF); } if ((proxyType0 == BroadphaseNativeType.BOX_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.SPHERE_SHAPE_PROXYTYPE)) { return(sphereBoxCF); } if ((proxyType0 == BroadphaseNativeType.CAPSULE_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.CAPSULE_SHAPE_PROXYTYPE)) { return(capsuleCapsuleCF); } if ((proxyType0 == BroadphaseNativeType.BOX_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.CAPSULE_SHAPE_PROXYTYPE)) { return(boxCapsuleCF); } if ((proxyType0 == BroadphaseNativeType.CAPSULE_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.BOX_SHAPE_PROXYTYPE)) { return(boxCapsuleCF); } if ((proxyType0 == BroadphaseNativeType.BOX_SHAPE_PROXYTYPE) && (proxyType1 == BroadphaseNativeType.BOX_SHAPE_PROXYTYPE)) { return(boxBoxCF); } // failed to find an algorithm return(emptyCreateFunc); }
static extern void btCollisionDispatcher_registerClosestPointsCreateFunc(IntPtr obj, BroadphaseNativeType proxyType0, BroadphaseNativeType proxyType1, IntPtr createFunc);
static extern bool btBroadphaseProxy_isSoftBody(BroadphaseNativeType proxyType);
static extern bool btBroadphaseProxy_isNonMoving(BroadphaseNativeType proxyType);
static extern bool btBroadphaseProxy_isCompound(BroadphaseNativeType proxyType);
public static bool IsPolyhedral(BroadphaseNativeType proxyType) { return btBroadphaseProxy_isPolyhedral(proxyType); }
public static bool IsSoftBody(BroadphaseNativeType proxyType) { return btBroadphaseProxy_isSoftBody(proxyType); }
public static bool IsNonMoving(BroadphaseNativeType proxyType) { return btBroadphaseProxy_isNonMoving(proxyType); }
public static bool IsInfinite(BroadphaseNativeType proxyType) { return btBroadphaseProxy_isInfinite(proxyType); }
public static bool IsConvex2D(BroadphaseNativeType proxyType) { return btBroadphaseProxy_isConvex2d(proxyType); }
public static bool IsPolyhedral(BroadphaseNativeType proxyType) { return(btBroadphaseProxy_isPolyhedral(proxyType)); }
static extern bool btBroadphaseProxy_isConvex2d(BroadphaseNativeType proxyType);
public static bool IsCompound(BroadphaseNativeType proxyType) { return(btBroadphaseProxy_isCompound(proxyType)); }
static extern bool btBroadphaseProxy_isInfinite(BroadphaseNativeType proxyType);
public static bool IsConcave(BroadphaseNativeType proxyType) { return btBroadphaseProxy_isConcave(proxyType); }
static extern bool btBroadphaseProxy_isPolyhedral(BroadphaseNativeType proxyType);
public abstract CollisionAlgorithmCreateFunc GetCollisionAlgorithmCreateFunc(BroadphaseNativeType proxyType0, BroadphaseNativeType proxyType1);
static extern void btCompoundShapeChild_setChildShapeType(IntPtr obj, BroadphaseNativeType value);
static extern void btCollisionDispatcher_registerCollisionCreateFunc(IntPtr obj, BroadphaseNativeType proxyType0, BroadphaseNativeType proxyType1, IntPtr createFunc);
public override CollisionAlgorithmCreateFunc GetCollisionAlgorithmCreateFunc(BroadphaseNativeType proxyType0, BroadphaseNativeType proxyType1) { IntPtr createFunc = btCollisionConfiguration_getCollisionAlgorithmCreateFunc(_native, (int)proxyType0, (int)proxyType1); if (proxyType0 == BroadphaseNativeType.BoxShape && proxyType1 == BroadphaseNativeType.BoxShape) { return(new BoxBoxCollisionAlgorithm.CreateFunc(createFunc)); } if (proxyType0 == BroadphaseNativeType.SphereShape && proxyType1 == BroadphaseNativeType.SphereShape) { return(new SphereSphereCollisionAlgorithm.CreateFunc(createFunc)); } if (proxyType0 == BroadphaseNativeType.SphereShape && proxyType1 == BroadphaseNativeType.TriangleShape) { return(new SphereTriangleCollisionAlgorithm.CreateFunc(createFunc)); } if (proxyType0 == BroadphaseNativeType.TriangleShape && proxyType1 == BroadphaseNativeType.SphereShape) { return(new SphereTriangleCollisionAlgorithm.CreateFunc(createFunc)); } if (proxyType0 == BroadphaseNativeType.StaticPlaneShape && BroadphaseProxy.IsConvex(proxyType1)) { return(new ConvexPlaneCollisionAlgorithm.CreateFunc(createFunc)); } if (proxyType1 == BroadphaseNativeType.StaticPlaneShape && BroadphaseProxy.IsConvex(proxyType0)) { return(new ConvexPlaneCollisionAlgorithm.CreateFunc(createFunc)); } if (BroadphaseProxy.IsConvex(proxyType0) && BroadphaseProxy.IsConvex(proxyType1)) { return(new ConvexConvexAlgorithm.CreateFunc(createFunc)); } if (BroadphaseProxy.IsConvex(proxyType0) && BroadphaseProxy.IsConcave(proxyType1)) { return(new ConvexConcaveCollisionAlgorithm.CreateFunc(createFunc)); } if (BroadphaseProxy.IsConvex(proxyType1) && BroadphaseProxy.IsConcave(proxyType0)) { return(new ConvexConcaveCollisionAlgorithm.SwappedCreateFunc(createFunc)); } if (BroadphaseProxy.IsCompound(proxyType0)) { return(new CompoundCompoundCollisionAlgorithm.CreateFunc(createFunc)); } if (BroadphaseProxy.IsCompound(proxyType1)) { return(new CompoundCompoundCollisionAlgorithm.SwappedCreateFunc(createFunc)); } return(new EmptyAlgorithm.CreateFunc(createFunc)); }
public static bool IsConvex(BroadphaseNativeType proxyType) { return btBroadphaseProxy_isConvex(proxyType); }
public static bool IsNonMoving(BroadphaseNativeType proxyType) { return(btBroadphaseProxy_isNonMoving(proxyType)); }
public static bool IsSoftBody(BroadphaseNativeType proxyType) { return(btBroadphaseProxy_isSoftBody(proxyType)); }
public static bool IsConcave(BroadphaseNativeType proxyType) { return(btBroadphaseProxy_isConcave(proxyType)); }
public override CollisionAlgorithmCreateFunc GetCollisionAlgorithmCreateFunc(BroadphaseNativeType proxyType0, BroadphaseNativeType proxyType1) { IntPtr createFunc = btCollisionConfiguration_getCollisionAlgorithmCreateFunc(_native, (int)proxyType0, (int)proxyType1); if (proxyType0 == BroadphaseNativeType.BoxShape && proxyType1 == BroadphaseNativeType.BoxShape) { return new BoxBoxCollisionAlgorithm.CreateFunc(createFunc); } if (proxyType0 == BroadphaseNativeType.SphereShape && proxyType1 == BroadphaseNativeType.SphereShape) { return new SphereSphereCollisionAlgorithm.CreateFunc(createFunc); } if (proxyType0 == BroadphaseNativeType.SphereShape && proxyType1 == BroadphaseNativeType.TriangleShape) { return new SphereTriangleCollisionAlgorithm.CreateFunc(createFunc); } if (proxyType0 == BroadphaseNativeType.TriangleShape && proxyType1 == BroadphaseNativeType.SphereShape) { return new SphereTriangleCollisionAlgorithm.CreateFunc(createFunc); } if (proxyType0 == BroadphaseNativeType.StaticPlaneShape && BroadphaseProxy.IsConvex(proxyType1)) { return new ConvexPlaneCollisionAlgorithm.CreateFunc(createFunc); } if (proxyType1 == BroadphaseNativeType.StaticPlaneShape && BroadphaseProxy.IsConvex(proxyType0)) { return new ConvexPlaneCollisionAlgorithm.CreateFunc(createFunc); } if (BroadphaseProxy.IsConvex(proxyType0) && BroadphaseProxy.IsConvex(proxyType1)) { return new ConvexConvexAlgorithm.CreateFunc(createFunc); } if (BroadphaseProxy.IsConvex(proxyType0) && BroadphaseProxy.IsConcave(proxyType1)) { return new ConvexConcaveCollisionAlgorithm.CreateFunc(createFunc); } if (BroadphaseProxy.IsConvex(proxyType1) && BroadphaseProxy.IsConcave(proxyType0)) { return new ConvexConcaveCollisionAlgorithm.SwappedCreateFunc(createFunc); } if (BroadphaseProxy.IsCompound(proxyType0)) { return new CompoundCompoundCollisionAlgorithm.CreateFunc(createFunc); } if (BroadphaseProxy.IsCompound(proxyType1)) { return new CompoundCompoundCollisionAlgorithm.SwappedCreateFunc(createFunc); } return new EmptyAlgorithm.CreateFunc(createFunc); }
public static bool IsCompound(BroadphaseNativeType proxyType) { return btBroadphaseProxy_isCompound(proxyType); }