Report PS3 accelerometer values in m/s2 instead of Gs

This commit is contained in:
Sam Lantinga
2023-04-19 13:10:39 -07:00
parent 9d18b4b5ed
commit 0467301baf

View File

@@ -306,7 +306,7 @@ static float HIDAPI_DriverPS3_ScaleAccel(Sint16 value)
{
/* Accelerometer values are in big endian order */
value = SDL_SwapBE16(value);
return (float)(value - 511) / 113.0f;
return ((float)(value - 511) / 113.0f) * SDL_STANDARD_GRAVITY;
}
static void HIDAPI_DriverPS3_HandleMiniStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Context *ctx, Uint8 *data, int size)