Approach to a minimal collision detection engine?

Topics: Developer Forum, User Forum
Dec 11, 2009 at 8:55 AM
Edited Dec 12, 2009 at 11:55 AM

Hi, first of all I'd like to say thank you to the developers of this lovely engine. I was surprised at how quick I was able to make a quick sample and have it running. That says a lot about Farseer Physics, giving my non-existent knowledge of game physics -) Bravo, guys!

Here's my question. If I want to only use the collision detection functions sans other physics functions, (such as in a simple shoot 'em up game where rigid body collision is not needed) what are the minimal components it would require? In this case the only thing Farseer has to do is when collision happens notify the game, any other physics behavior is disabled.

One way I am doing it is make OnCollision event handler return false so that Farseer will let the sprite body pierce through other bodies,  and then manually update Body.Position's value in the game logic. Is it a good approach and is there any other way?

Also, updating Body.Position outside of Farseer also creates a problem for simulating rigid body collision: the sprite will be drawn even when its edge overlaps with another sprite, since Farseer cannot 'predict' Body.Position and 'intercept' the sprite move orders... Anyone got a good idea around this?