Author Topic: Changing world gravity  (Read 706 times)

I need a way to affect server gravity as a whole that'll work for vehicles. I can use a velocity loop, but it's not pretty and causes everything to shoot upwards if the server lags.

Is there any way to change the world gravity directly, or do I just have to use velocity loops?

Changing it through memory would require modifying the following:

vehicle.cc
const F32 sVehicleGravity = -20;

wheeledVehicle.cc
static F32 sWheeledVehicleGravity = -20;

player.cc
F32 Player::mGravity = -20.0f;

item.cc
F32 Item::mGravity = -20;

debris.cc
Point3F force = Point3F(0, 0, -9.81 * mDataBlock->gravModifier );

.. and so on and so on. There is no simple, clean way to change the gravity for all players, vehicles, items, projectiles, etc.

Lovely. Guess I'll just have to use a velocity loop.

Can't you use a physical zone to change the gravity for everything?

That only works for players.