The orientation and motion of the controller.


class GCMotion : NSObject


Figure 1 shows the coordinate system used when presenting device data.

Figure 1

Orientation of the device axis


Determining the Controller That Owns This Profile

var controller: GCController?

The controller this profile is associated with.

Determining When New Motion Data is Available

var valueChangedHandler: GCMotionValueChangedHandler?

A block called when any value in the profile changes.

Reading the Controller’s Motion Data

var hasAttitudeAndRotationRate: Bool

Returns whether the controller can return data for attitude and rotation rate.

var gravity: GCAcceleration

The gravity vector, expressed in the controller's reference frame.

var userAcceleration: GCAcceleration

The acceleration that the user is giving to the controller.

var attitude: GCQuaternion

The current attitude of the controller.

var rotationRate: GCRotationRate

The current rotation rate of the controller.


typealias GCMotionValueChangedHandler

Signature for the block executed if values in the motion profile change.

struct GCAcceleration

A 3-dimensional acceleration vector.

struct GCRotationRate

A structure that provides rotation rates around the x, y, and z axis.

struct GCEulerAngles

A structure that specifies the controller’s attitude as a series of rotations around the x, y, and z axis. The rotations are performed in that order.

struct GCQuaternion

A quaternion structure uses to parameterize the attitude information of the controller.


Inherits From

Conforms To

See Also

Control Profiles

class GCExtendedGamepad

The extended set of gamepad controls.

class GCGamepad

The standard set of gamepad controls.

class GCMicroGamepad

The controls provided by the Siri Remote.