Rotate the sensor axes to match gamepad orientation when using the device sensors for game controllers

This commit is contained in:
Sam Lantinga committed 2023-06-16 17:48:34 -07:00
1 parent a9c86e518a
commit 8de6ce7e92
2 files changed
+28 -8

No files matched your search

+4 -6
View File
@@ -89,13 +89,12 @@ typedef enum
* values[1]: Acceleration on the y axis
* values[2]: Acceleration on the z axis
*
* For phones held in portrait mode and game controllers held in front of you,
* the axes are defined as follows:
* For phones and tablets held in natural orientation and game controllers held in front of you, 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.
* The axis data is not changed when the device is rotated.
*
* \sa SDL_GetDisplayOrientation()
*/
@@ -114,13 +113,12 @@ typedef enum
* values[1]: Angular speed around the y axis (yaw)
* values[2]: Angular speed around the z axis (roll)
*
* For phones held in portrait mode and game controllers held in front of you,
* the axes are defined as follows:
* For phones and tablets held in natural orientation and game controllers held in front of you, 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 or controller is rotated.
* The axis data is not changed when the device is rotated.
*
* \sa SDL_GetDisplayOrientation()
*/