Skip to content

Commit

Permalink
Report PS3 accelerometer values in m/s2 instead of Gs
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 19, 2023
1 parent 9d18b4b commit 0467301
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick/hidapi/SDL_hidapi_ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0467301

Please sign in to comment.