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
-
accelerationThe KKAcceleration object used by KKDeviceMotion to store user acceleration.
property -
gravityThe KKAcceleration object used by KKDeviceMotion to store the gravity acceleration vector.
property -
rotationRateThe KKRotationRate object used by KKDeviceMotion to store the rotation rate reported by gyroscope.
property -
attitudeReturns 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 -
rollThe roll euler angle of CMAttitude.
property -
pitchThe pitch euler angle of CMAttitude.
property -
yawThe yaw euler angle of CMAttitude.
property -
– resetSets 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 *accelerationDeclared In
KKDeviceMotion.hattitude
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 *attitudeDeclared In
KKDeviceMotion.hgravity
The KKAcceleration object used by KKDeviceMotion to store the gravity acceleration vector.
@property (nonatomic, readonly) KKAcceleration *gravityDeclared In
KKDeviceMotion.hpitch
The pitch euler angle of CMAttitude.
@property (nonatomic, readonly) double pitchDeclared In
KKDeviceMotion.hroll
The roll euler angle of CMAttitude.
@property (nonatomic, readonly) double rollDeclared In
KKDeviceMotion.h