This project has moved. For the latest updates, please go here.

Simulate gravity in the Z direction?

Mar 16, 2010 at 7:28 PM

The game I making is a 2D game, but rather than it being in the more common "Side-scrolling" perspective which would have gravity being in the +Y direction, our game is of the top-down view variety, like you could imagine a 2D Billiards game. So when we initialize the simulator, we set gravity to (0,0) to avoid making our geometries "fall". 

To stick with the billiards scenario, when our ball -- let's say the cue ball -- is rolling along the green without coming into contact with anything there is no friction being applied to the ball to slow it down and no force like gravity being asserted to do it either. 

Is there a simple way to simulate gravity in the Z direction using Farseer? So far the only idea I have is continually call a ZGravity function that just reduces the velocity, which would work I suppose, but I just wanted to make sure there wasn't already an intended means to do this.

Mar 18, 2010 at 8:47 PM

If I understand you properly then you should be able to use LinearDragCoeffecient which will slow down your body.

I was planning to use this to make a top down racing game based on the farseer engine.