If you want to know collisions at the level of contact points, an actual collidable object will need to be tested. It's possible to avoid adding an object to the space, though. Use the NarrowPhaseHelper.Intersecting function if you know the involved collidables and all you need is the boolean collision state.
If you don't know the involved collidables, using GetEntries can collect them for you. If you want more than the boolean collision state, you can manually create the collision pair using NarrowPhasePairHandler.GetPairHandler.
Grabbing a pair handler directly requires a little bit of boilerplate to avoid leaking/triggering spurious events. You'll want to follow this pattern:
Code: Select all
var pairHandler = NarrowPhaseHelper.GetPairHandler(ref pair);
pairHandler.SuppressEvents = true;
pairHandler.UpdateCollision(0);
pairHandler.SuppressEvents = false;
//Analyze pair state. Check for contacts or whatever else.
pairHandler.CleanUp();
pairHandler.Factory.GiveBack(pairHandler);
(Making that less gross has been on my to-do list for a while now.)