Page 1 of 1

Unit of Gravity in physics

Posted: Thu May 02, 2013 11:12 am
by claudemiro
In what unit gravity is measured?, for example, in the real world the gravity is measured in m/s², being 9.80665 m/s² the earth gravity. I just could not find in the docs. Thanks

Re: Unit of Gravity in physics

Posted: Thu May 02, 2013 1:14 pm
by bartbes
Whatever unit you use everywhere else, typically $$ \frac{px}{s^2} $$, but really, it's up to you.

(Excuse me for the broken latex, I'll go bug our site admin.)

Re: Unit of Gravity in physics

Posted: Thu May 02, 2013 1:21 pm
by adnzzzzZ
http://www.love2d.org/wiki/love.physics.setMeter

From what I can understand you set the size (in pixels) of a meter and then use pixels as usual in your code. So if you setMeter(32), a 10 meter box2d object will have 320 pixels in your game.

Re: Unit of Gravity in physics

Posted: Thu May 02, 2013 1:34 pm
by claudemiro
Thanks for your responses, but, in some examples I see people setting gravity to 200 why 200?

Code: Select all

love.physics.newWorld(0, 200, true)

Re: Unit of Gravity in physics

Posted: Thu May 02, 2013 2:49 pm
by adnzzzzZ
Because they set the world gravity in pixels/s².

Re: Unit of Gravity in physics

Posted: Thu May 02, 2013 4:08 pm
by kikito
When I used physics, I just adjusted gravity "manually" until it "felt right". I don't even remember what was the final value. Nor do I really care.

Re: Unit of Gravity in physics

Posted: Thu May 02, 2013 4:13 pm
by bartbes
Also, realism is only fun up to a point. Expect to fiddle a lot with numbers when implementing physics, it's all about the feel, not the correctness.

Re: Unit of Gravity in physics

Posted: Thu May 02, 2013 4:46 pm
by claudemiro
Thank you.