Compartilhar via


GameInputMotionState

Describes the state of motion input from a motion-enabled input device.

Syntax

typedef struct GameInputMotionState {  
    float accelerationX;  
    float accelerationY;  
    float accelerationZ;  
    float angularVelocityX;  
    float angularVelocityY;  
    float angularVelocityZ;  
    float magneticFieldX;  
    float magneticFieldY;  
    float magneticFieldZ;  
    float orientationW;  
    float orientationX;  
    float orientationY;  
    float orientationZ;  
    GameInputMotionAccuracy accelerometerAccuracy;
    GameInputMotionAccuracy gyroscopeAccuracy;
    GameInputMotionAccuracy magnetometerAccuracy;  
    GameInputMotionAccuracy orientationAccuracy;  
} GameInputMotionState  

Members

accelerationX
Type: float

Acceleration along the x-axis.

accelerationY
Type: float

Acceleration along the y-axis.

accelerationZ
Type: float

Acceleration along the z-axis.

angularVelocityX
Type: float

Angular velocity around the x-axis.

angularVelocityY
Type: float

Angular velocity around the y-axis.

angularVelocityZ
Type: float

Angular velocity around the z-axis.

magneticFieldX
Type: float

Magnetic field along the x-axis.

magneticFieldY
Type: float

Magnetic field along the y-axis.

magneticFieldZ
Type: float

Magnetic field along the z-axis.

orientationW
Type: float

Orientation compared to the w-axis.

orientationX
Type: float

Orientation compared to the x-axis.

orientationY
Type: float

Orientation compared to the y-axis.

orientationZ
Type: float

Orientation compared to the z-axis.

accelerometerAccuracy
Type: GameInputMotionAccuracy

Level of accuracy of the accelerometer values.

gyroscopeAccuracy
Type: GameInputMotionAccuracy

Level of accuracy of the gyroscope values.

magnetometerAccuracy
Type: GameInputMotionAccuracy

Level of accuracy of the magnetometer values.

orientationAccuracy
Type: GameInputMotionAccuracy

Level of accuracy of the orientation values.

Remarks

The value of each member ranges from 0.0 through 1.0, where 1.0 represents 100 percent of the maximum magnitude specified in the GameInputMotionInfo structure.

This structure is used by the IGameInputReading::GetMotionState method.

For more information, see the Getting data from readings section of GameInput readings. For a related code example, see A simple gamepad input loop.

Requirements

Header: GameInput.h

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

Input API Overview
GameInput