Mar 5, 2012 at 10:35 PM
Edited Mar 5, 2012 at 10:35 PM
If it would help: for a sufficiently small time step AND low velocity motion is linear (bodies can also rotate but that's not relevant here). Since we are dealing with a physics engine that uses discrete time steps we're in that situation for common scenarios.
Curving motion over time is approximated with small linear movements and rotation over multiple time steps. So if you implement your bullets with some form of integration (i'd reccomend Verlet) your code might looks like this:
In update method:
find new position with Verlet (or with Euler but you'll have to keep track of velocity too):
cast Farseer ray between old position and new position - if there is a fixture hit add to list
foreach (hit): boom - delete particle and explode body
finally call World.Step()
If you would decide to extend your requirements one day with fancy physics projectiles (e.g. a water jet, blast bomb, elastic balls or whatever worms-style weapon) instead of deleting them you could add them to the world with their properties, ApplyForce()
to them before calling World.Step() and get the physics engine to do the work for you.
The main point is that if you implement your own system you could always stay one step ahead of the physics (make sure you use fixed time step) and this makes it possible to have priority in your logic since you're lucky to need only one way collision.