internal static bool ContactPairTest(CollisionObject colA, CollisionObject colB) { var cb = new ContactResultCallback(); world.ContactPairTest(colA.BulletCollisionObject, colB.BulletCollisionObject, cb); return(cb.Collides.Count > 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); }
public void AddContactPairTest(RigidBody firstBody, RigidBody secondBody, ContactResultCallback callback) => dynamicsWorld.ContactPairTest(firstBody, secondBody, callback);