KKDeviceMotion Class Reference
Inherits from | NSObject |
Declared in | KKDeviceMotion.h |
Overview
Contains the deviceMotion data. DeviceMotion is only available on devices running iOS 4.0 or newer. The rotationRate and attitude are only available on 4th generation iPhone & iPod touch devices and newer, and iPad 2 and newer.
See the CMDeviceMotion class reference: http://developer.apple.com/library/ios/#documentation/CoreMotion/Reference/CMDeviceMotion_Class/Reference/Reference.html#//apple_ref/doc/c_ref/CMDeviceMotion
Tasks
-
acceleration
The KKAcceleration object used by KKDeviceMotion to store user acceleration.
property -
gravity
The KKAcceleration object used by KKDeviceMotion to store the gravity acceleration vector.
property -
rotationRate
The KKRotationRate object used by KKDeviceMotion to store the rotation rate reported by gyroscope.
property -
attitude
Returns the CMAttitude object used by KKDeviceMotion. Is only non-nil when KKInput deviceMotionActive=YES. Contains the attitude as euler angles (roll, pitch, yaw), rotation matrix (CMRotationMatrix), or quaternion (CMQuaternion). On Mac attitude is of type id.
property -
roll
The roll euler angle of CMAttitude.
property -
pitch
The pitch euler angle of CMAttitude.
property -
yaw
The yaw euler angle of CMAttitude.
property -
– reset
Sets all internal values to 0. Call this method after an interruption in your application, for example the pause menu or starting a new level.
Properties
acceleration
The KKAcceleration object used by KKDeviceMotion to store user acceleration.
@property (nonatomic, readonly) KKAcceleration *acceleration
Declared In
KKDeviceMotion.h
attitude
Returns the CMAttitude object used by KKDeviceMotion. Is only non-nil when KKInput deviceMotionActive=YES. Contains the attitude as euler angles (roll, pitch, yaw), rotation matrix (CMRotationMatrix), or quaternion (CMQuaternion). On Mac attitude is of type id.
@property (nonatomic, copy) CMAttitude *attitude
Declared In
KKDeviceMotion.h
gravity
The KKAcceleration object used by KKDeviceMotion to store the gravity acceleration vector.
@property (nonatomic, readonly) KKAcceleration *gravity
Declared In
KKDeviceMotion.h
pitch
The pitch euler angle of CMAttitude.
@property (nonatomic, readonly) double pitch
Declared In
KKDeviceMotion.h
roll
The roll euler angle of CMAttitude.
@property (nonatomic, readonly) double roll
Declared In
KKDeviceMotion.h