Units used

Jul 11, 2012 at 5:47 PM

First of all, congratulations for this very useful library !

To my own understanding Farseer Physics use following units to define physical bodies : meters, kg, seconds.

In the library, the sizes and positions of objects is defined in pixels. I was wondering what is the correspondence used for lengths : 1px <=> 1m ?

Another question : I noticed that in all demos, gravity is defined to 500 but objects seem to move as if gravity was normal (earth's gravity). Why this value is used in place of 9,1m/s² ?

Thanks in advance !

Laurent

Coordinator
Jul 11, 2012 at 8:03 PM

For size and position, it comes down to 100 pixels per meter.

If you look at BoundaryHelperBox2D, there is a constant "pixelsPerMeter" which you could toy with there (I suppose I should make that a public property!)

Where are you seeing Gravity 500? I think that might be the older (Farseer 2 code?) If you look at PhysicsCanvas.GravityVertical, it should default to 10.

Jul 11, 2012 at 9:11 PM

Hi Andy,

Thank you for your answer.

You're right (and I didn't write it in my first post), I use a previous release of your library and of Farseer (2.1) since I need to use it in a WPF application.

I don't remember a class called BoundaryHelperBox2D in this release but I'll check on tomorrow.

Do you remember how units were managed in these previous releases ?

Laurent