Game Development Community

Gravity not consistent?

by Jon Fernback · in Torque Game Engine · 02/01/2006 (1:13 pm) · 2 replies

I have been doing some digging in the engine lately for a change we are making to wheeled vehicle when I ran across something I found odd.

Why is the gravity in torque different for each object type? If you look in the source each type seems to have its own gravity as a static float of -20. This by itself is odd if you are looking for realism (what unit of measure has an acceleration due to gravity of 20? metric is 9.8 and imperial is 32.1 right?)

Then I did some more digging and found that several places in the engine hardcode gravity to 10
Then several other places hardcode gravity to 9.81

And to make matters worse, some places are making assumtions that gravity acc will never be more than 10, which is already wrong for any of the base shapes like player and vehicle, which were set to 20. I'm wondering if this inconsistency is one of the causes for collision penetration issues? Such as being able to pierce the ground with a vehicle at a high speed?

At the very least I think this needs to be cleaned up and made consistent.

#1
02/01/2006 (1:17 pm)
Actually, it's that way intentionally. Each object implements it's own physics, so that you can easily control the feel and play of a particular object and how it interacts with the environment.

Yes, it requires a bit of coordination betwen your separate class hierarchies, but in general it provides much more flexibility for the designers/developers to implement things how they want with the finest control.
#2
02/01/2006 (1:20 pm)
Yes but you can do that by using the gravity modifier for each object.

And either way there are different values assumed and hardcoded in equations throughout the engine.