Beispiel #1
0
        internal static bool ContactPairTest(CollisionObject colA, CollisionObject colB)
        {
            var cb = new ContactResultCallback();

            world.ContactPairTest(colA.BulletCollisionObject, colB.BulletCollisionObject, cb);
            return(cb.Collides.Count > 0);
        }
Beispiel #2
0
        static void TestContactTest(RigidBody testBody, RigidBody testBody2)
        {
            object context = "your context";
            ContactSensorCallback contactCallback = new ContactSensorCallback(testBody, context);

            world.ContactTest(testBody, contactCallback);

            testBody.CollisionFlags  |= CollisionFlags.CustomMaterialCallback;
            testBody2.CollisionFlags |= CollisionFlags.CustomMaterialCallback;
            world.ContactPairTest(testBody, testBody2, contactCallback);
            testBody.CollisionFlags  &= ~CollisionFlags.CustomMaterialCallback;
            testBody2.CollisionFlags &= ~CollisionFlags.CustomMaterialCallback;

            AddToDisposeQueue(contactCallback);
        }
Beispiel #3
0
 public void AddContactPairTest(RigidBody firstBody, RigidBody secondBody, ContactResultCallback callback) =>
 dynamicsWorld.ContactPairTest(firstBody, secondBody, callback);