This project is read-only.

Question about physics

Jul 7, 2012 at 11:24 PM

I was wondering if there are plans for a 2D physics engine to be added since BePu is for 3D and am wanting to use IGF to help make a 2D game once I figure out how to use it.

Jul 9, 2012 at 9:47 AM

Right now, I have no plans to add 2D physics to IGF. Still, you'll probably find someone in the SunBurn forums who actually implemented a Manager for FarSeer to the engine.

Still, you can use BEPU for a 2D game simply omitting one of the axis.

Ace on Steroids actually uses it in a 2D world forcing every SceneObject to stay at 0 on the Y axis using a component for that. But their might be a better way to handle this: I'd invite you to ask the question in the BEPU Physics forums (or even better search for it first) ;)

Jul 12, 2012 at 1:23 AM

I do roughly the same thing Philippe does in AoS, in that I use BEPU but constrain it to a 2D gameplay space. In my case, I do this by constraining my root starship entities to a Y=0 plane using... I forget which kind of joint it is. But doing it this way lets BEPU's solver worry about keeping it on the plane. You could pretty easily do this with side-scrollers or whatever else. I like the joint approach since it means if I want to, it's pretty trivial to introduce multiple layers of 2D space for a psuedo-3D experience.

Jul 12, 2012 at 2:43 PM

There is also nothing to stop you using Farseer or some other 2d physics engine on its own in conjunction with IGF - the modular way Phillipe has designed IGF means you can pick and choose the components you want - if you don't want to use BEPU just don't link the IGF Physics and use Farseer instead

If you're a reasonably experienced developer you would probably have very little difficulty integrating Farseer into IGF yourself, there are only a few classes to create and it's mainly implementing a few simple interfaces. For a bare minimum implementation you really only need a manager class which creates the Farseer World and calls World.Step in it's update method. And a few collision move classes which wrap the different types of Farseer Body types.