natiny_physics_set_gravity

C
void natiny_physics_set_gravity(float x, float y, float z);

Sets the acceleration applied to every dynamic body.

Parameters

Name Type Description
x float Acceleration along X, m/s^2
y float Acceleration along Y, m/s^2
z float Acceleration along Z, m/s^2

Example

C
natiny_physics_set_gravity(0.0f, -1.62f, 0.0f);   /* the Moon */

Notes

  • The world starts at (0, -9.81f, 0).
  • Takes effect on the next step. Sleeping bodies do not wake for it, so a scene that has come to rest stays at rest until something disturbs it.
  • Does nothing when physics is not running.