Unit of Gravity in physics

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
claudemiro
Prole
Posts: 3
Joined: Thu May 02, 2013 11:04 am

Unit of Gravity in physics

Post 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
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Unit of Gravity in physics

Post 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.)
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Unit of Gravity in physics

Post 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.
claudemiro
Prole
Posts: 3
Joined: Thu May 02, 2013 11:04 am

Re: Unit of Gravity in physics

Post 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)
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Unit of Gravity in physics

Post by adnzzzzZ »

Because they set the world gravity in pixels/s².
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Unit of Gravity in physics

Post 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.
When I write def I mean function.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Unit of Gravity in physics

Post 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.
claudemiro
Prole
Posts: 3
Joined: Thu May 02, 2013 11:04 am

Re: Unit of Gravity in physics

Post by claudemiro »

Thank you.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests