Unit of Gravity in physics
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 3
- Joined: Thu May 02, 2013 11:04 am
Unit of Gravity in physics
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
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Unit of Gravity in physics
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.)
(Excuse me for the broken latex, I'll go bug our site admin.)
Re: Unit of Gravity in physics
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.
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.
-
- Prole
- Posts: 3
- Joined: Thu May 02, 2013 11:04 am
Re: Unit of Gravity in physics
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
Because they set the world gravity in pixels/s².
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Unit of Gravity in physics
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.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Unit of Gravity in physics
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.
-
- Prole
- Posts: 3
- Joined: Thu May 02, 2013 11:04 am
Re: Unit of Gravity in physics
Thank you.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 4 guests