Problem with Gravity

ricardo_arango

12-08-2006 05:27:30

I am using 9.8m/s2 for gravity, but everything is falling really slow..

If I change it to 98 it works fine..

Why is that?

kjs335

12-08-2006 06:17:49

ive experienced it too and i think it's mainly because your model is too big.
create a 1m3 cube and see how fast it falls.

ricardo_arango

12-08-2006 17:41:52

But gravity is supposed to be only affected by mass, and the gravity constant on Earth:

F = m * -9.8

What does size have to do with it?

walaber

12-08-2006 19:58:55

nothing. it's an issue of relative scale.

gravity of -9.8m/s2 represents the acceleration due to gravity in METERS per second squared, right?

this means all other units of length/distance must also be expressed in Meters to make sense. so if you have a cube that is 100x100x100, and you put it about 500 above the world, that is like saying you have a 100 Meter cube, placed 500 meters above the ground. try dropping something from 500 meters up sometime, it will take a long time to reach the ground!

so, if you want to use 9.8 for gravity, make sure all other distances in your simulation are also accurate in terms of Meters. this means that human characters should be between 1.4~2.0 units tall, etc.

if for some reason you want to use objects with a different scale, just be sure you scale EVERYTHING the same. this includes the gravity constant, distances between objects, etc. for example if you wanted 1unit = 1cm, then gravity would be 98cm/s2, etc.

ricardo_arango

12-08-2006 20:23:55

I'll try and explain it better...

What I'm really trying to do is create a chain, like the one in the Demo2 in the OgreNewt samples.

I literally copied the part where it creates the chain into my code... and used the same mesh object from the media folder in OgreNewt..

But when I run my application... the gravity is at least 10 times slower..

Is there a place where I have to define the default units or something? Because I am using the same code and mesh, and it makes no sense...

ricardo_arango

12-08-2006 20:52:57

You're right......