Share via


GameInputSensorsState (v2)

Describes the state of sensors.

Syntax

struct GameInputSensorsState
{
    // GameInputSensorsAccelerometer
    float accelerationInGX;
    float accelerationInGY;
    float accelerationInGZ;

    // GameInputSensorsGyrometer
    float angularVelocityInRadPerSecX;
    float angularVelocityInRadPerSecY;
    float angularVelocityInRadPerSecZ;

    // GameInputSensorsCompass
    float headingInDegreesFromMagneticNorth;
    GameInputSensorAccuracy headingAccuracy;

    // GameInputSensorsOrientation
    float orientationW;
    float orientationX;
    float orientationY;
    float orientationZ;
};

Members

accelerationInGX Type: float

Linear acceleration, in g-force, with respect to the x axis. Valid if GameInputSensorsInfo reports GameInputSensorsKindAccelerometer.

accelerationInGY Type: float

Linear acceleration, in g-force, with respect to the y axis. Valid if GameInputSensorsInfo reports GameInputSensorsKindAccelerometer.

accelerationInGZ Type: float

Linear acceleration, in g-force, with respect to the z axis. Valid if GameInputSensorsInfo reports GameInputSensorsKindAccelerometer.

angularVelocityInRadPerSecX Type: float

Angular velocity, in radians per second, with respect to the x axis. Valid if GameInputSensorsInfo reports GameInputSensorsKindGyrometer.

angularVelocityInRadPerSecY Type: float

Angular velocity, in radians per second, with respect to the y axis. Valid if GameInputSensorsInfo reports GameInputSensorsKindGyrometer.

angularVelocityInRadPerSecZ Type: float

Angular velocity, in radians per second, with respect to the z axis. Valid if GameInputSensorsInfo reports GameInputSensorsKindGyrometer.

headingInDegreesFromMagneticNorth Type: float

Heading, in degrees, from magnetic north. Range: [0, 360). Valid if GameInputSensorsInfo reports GameInputSensorsKindCompass.

headingAccuracy Type: GameInputSensorAccuracy

Accuracy of the heading. Valid if GameInputSensorsInfo reports GameInputSensorsKindCompass.

orientationW Type: float

The w-component of a quaternion representing the device's orientation. Valid if GameInputSensorsInfo reports GameInputSensorsKindOrientation.

orientationX Type: float

The x-component of a quaternion representing the device's orientation. Valid if GameInputSensorsInfo reports GameInputSensorsKindOrientation.

orientationY Type: float

The y-component of a quaternion representing the device's orientation. Valid if GameInputSensorsInfo reports GameInputSensorsKindOrientation.

orientationZ Type: 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.

Requirements

Header: GameInput.h

Supported platforms: Windows

See also

Overview of GameInput GameInput