diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index 6fe799fbd9c..cf179502b22 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -7313,14 +7313,75 @@ struct retro_device_power }; enum retro_sensor_selector { + + /** + * Returns the device's acceleration along its local X axis minus the effect of gravity, in m/s^2. + * + * Positive values mean that the device is accelerating to the right. + * assuming the user is looking at it head-on. + */ RETRO_SENSOR_ACCELEROMETER_X, + + /** + * Returns the device's acceleration along its local Y axis minus the effect of gravity, in m/s^2. + * + * Positive values mean that the device is accelerating upwards, + * assuming the user is looking at it head-on. + */ RETRO_SENSOR_ACCELEROMETER_Y, + + /** + * Returns the the device's acceleration along its local Z axis minus the effect of gravity, in m/s^2. + * + * Positive values indicate forward acceleration towards the user, + * assuming the user is looking at the device head-on. + */ RETRO_SENSOR_ACCELEROMETER_Z, + + /** + * Returns the angular velocity of the device around its local X axis, in radians per second. + * + * Positive values indicate counter-clockwise rotation. + * + * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. + * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope + * for guidance on using this value to derive a device's orientation. + */ RETRO_SENSOR_GYROSCOPE_X, + + /** + * Returns the angular velocity of the device around its local Z axis, in radians per second. + * + * Positive values indicate counter-clockwise rotation. + * + * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. + * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope + * for guidance on using this value to derive a device's orientation. + */ RETRO_SENSOR_GYROSCOPE_Y, + + /** + * Returns the angular velocity of the device around its local Z axis, in radians per second. + * + * Positive values indicate counter-clockwise rotation. + * + * @note A radian is about 57 degrees, and a full 360-degree rotation is 2*pi radians. + * @see https://developer.android.com/reference/android/hardware/SensorEvent#sensor.type_gyroscope + * for guidance on using this value to derive a device's orientation. + */ RETRO_SENSOR_GYROSCOPE_Z, + + /** + * Returns the ambient illuminance (light intensity) of the device's environment, in lux. + * + * @see https://en.wikipedia.org/wiki/Lux for a table of common lux values. + */ RETRO_SENSOR_ILLUMINANCE, + + RETRO_SENSOR_MAX, + + /** Dummy value to ensure sizeof(enum retro_hw_context_type) == sizeof(int). Do not use. */ RETRO_SENSOR_SELECTOR_DUMMY=INT_MAX }; /** @} */