Aug 14, 2009 at 6:58 PM
Edited Aug 14, 2009 at 6:59 PM
1. As you mention, usually it is a matter of taste. In this case tho, it was simply because Euler is the most basic ODE (Ordinary Differential Equation) solver. The first Farseer Physics engine was as simple as they come. Euler integrator, brute force broad
phase, distance grid narrow phase and the basics of sequential impulse with warm starting. It was built on Box2D lite back in the day.
The goal was a simple physics engine and thus it could also be very slow. Since then it has received several broadphases/narrowphases, caching and more elaborate physics.
2. I agree. I don't like the manual inline either, but it was necessary to get it running at a decent speed on the Xbox 360. The .net compiler has since then become better at optimizing code (it can inline with structs as argument in methods now) but manual
inlining still beats it. To keep the physics engine simple while also running with decent performance on Xbox, we had no choice but to do a lot of manual optimizations to the code.
In 3.0 the algorithms will be a lot more complex but also a lot faster. Several optimization methods have been implemented to get the most out of the engine and already now we have a faster engine than older versions of Farseer Physics.
Thanks for writing about this. I like that people take their time to dig into the code and try to improve it. The current code has a lot of community contributed code that makes the engine what it is today. With 3.0 we start from scratch and with our previous
and hopefully new contributions, we will get a better, fully featured and more efficient engine.