[][src]Constant fermium::sensor::SDL_STANDARD_GRAVITY

pub const SDL_STANDARD_GRAVITY: c_float = 9.80665;

Accelerometer sensor

The accelerometer returns the current acceleration in SI meters per second squared. This includes gravity, so a device at rest will have an acceleration of SDL_STANDARD_GRAVITY straight down.

  • values[0]: Acceleration on the x axis
  • values[1]: Acceleration on the y axis
  • values[2]: Acceleration on the z axis

For phones held in portrait mode, the axes are defined as follows:

  • -X ... +X : left ... right
  • -Y ... +Y : bottom ... top
  • -Z ... +Z : farther ... closer

The axis data is not changed when the phone is rotated.

See Also: [SDL_GetDisplayOrientation]