GameInputSensorsState
Describes the state of sensors.Syntax
Members
accelerationInGXType: float Linear acceleration, in g-force, with respect to the x axis. Valid if
GameInputSensorsInfo reports GameInputSensorsKindAccelerometer.
accelerationInGYType: float Linear acceleration, in g-force, with respect to the y axis. Valid if
GameInputSensorsInfo reports GameInputSensorsKindAccelerometer.
accelerationInGZType: float Linear acceleration, in g-force, with respect to the z axis. Valid if
GameInputSensorsInfo reports GameInputSensorsKindAccelerometer.
angularVelocityInRadPerSecXType: float Angular velocity, in radians per second, with respect to the x axis. Valid if
GameInputSensorsInfo reports
GameInputSensorsKindGyrometer.
angularVelocityInRadPerSecYType: float Angular velocity, in radians per second, with respect to the y axis. Valid if
GameInputSensorsInfo reports
GameInputSensorsKindGyrometer.
angularVelocityInRadPerSecZType: float Angular velocity, in radians per second, with respect to the z axis. Valid if
GameInputSensorsInfo reports
GameInputSensorsKindGyrometer.
headingInDegreesFromMagneticNorthType: float Heading, in degrees, from magnetic north. Range: [0, 360). Valid if
GameInputSensorsInfo reports
GameInputSensorsKindCompass.
headingAccuracyType: GameInputSensorAccuracy Accuracy of the heading. Valid if
GameInputSensorsInfo reports GameInputSensorsKindCompass.
orientationWType: float The w-component of a quaternion representing the device’s orientation. Valid if
GameInputSensorsInfo reports
GameInputSensorsKindOrientation.
orientationXType: float The x-component of a quaternion representing the device’s orientation. Valid if
GameInputSensorsInfo reports
GameInputSensorsKindOrientation.
orientationYType: float The y-component of a quaternion representing the device’s orientation. Valid if
GameInputSensorsInfo reports
GameInputSensorsKindOrientation.
orientationZType: float The z-component of a quaternion representing the device’s orientation. Valid if
GameInputSensorsInfo reports
GameInputSensorsKindOrientation.
Remarks
This structure is used by the IGameInputReading::GetSensorsState method. For more information, see GameInput readings. The presence of valid data is indicated by GameInputKindSensors in GameInputDeviceInfo. Data that is not reported as being present will be filled with default at-rest values.Coordinate system
Devices are expected to report device acceleration as a Y-up right-handed system. Angular velocity follows the right-hand rule about these axes.
The X axis goes from the center of the device towards the right. The Y axis goes from the center of the device towards
the user’s face. The Z axis goes from the center of the device out the bottom.
Sample acceleration output, in g:
- Device laying flat on table:
- Angular velocity at rest, in radians per second, is
- From there, lift device upwards: increases
- From there, drop device: decreases
- Rotate device so top edge is in air and bottom edge is on surface:
- While in motion, angular velocity X becomes positive:
- Go back to flat.
- Rotate device so left edge is in air and right edge is on surface:
- While in motion, angular velocity Z becomes negative:
- Go back to flat.
- Rotate device clockwise (opposite to right-hand rule)
- While in motion, angular velocity Y becomes negative:
Requirements
Header: GameInput.h Supported platforms: Windows, XBOX One family consoles and XBOX Series consolesConceptual documentation
See also
Overview of GameInputGameInput


