KKAcceleration Class Reference
| Inherits from | NSObject |
| Declared in | KKAcceleration.h |
Overview
Contains the current accelerometer values. You can access the raw values as reported by the accelerometer, the smoothed values which have a low-pass filter applied to them (reacts slowly to sudden acceleration, averages the continous acceleration), or the instantaneous values which have a high-pass filter applied to them (reacts mostly to sudden acceleration, little to continuous acceleration). The filtering algorithm for smoothed and instantaneous values is only run once per frame, and only when you access one of the smoothed or instantaneous properties.
See the Event Handling Guide for iOS for more information about high and low pass filtering applied to the smoothed and instantaneous values: http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/MotionEvents/MotionEvents.html#//apple_ref/doc/uid/TP40009541-CH4-SW1
Acceleration along the axis' is in G’s (gravitational force). According to Apple: “A G is a unit of gravitation force equal to that exerted by the earth’s gravitational field (9.81 m s−2).”
Tasks
-
timestampThe timeStamp when the accelerometer was last sampled.
property -
rawXRaw acceleration in G’s along the x axis. Value is already transformed to current device orientation.
property -
rawYRaw acceleration in G’s along the y axis. Value is already transformed to current device orientation.
property -
rawZRaw acceleration in G’s along the z axis.
property -
xSame as rawX.
property -
ySame as rawY.
property -
zSame as rawZ.
property -
smoothedXSmoothed value using a low-pass filter influenced by the filteringFactor property. Smoothed values are averaged over several frames and responds barely to sudden changes of motion (eg shaking or dropping the device). Value is already transformed to current device orientation.
property -
smoothedYSmoothed value using a low-pass filter influenced by the filteringFactor property. Smoothed values are averaged over several frames and responds barely to sudden changes of motion (eg shaking or dropping the device). Value is already transformed to current device orientation.
property -
smoothedZSmoothed value using a low-pass filter influenced by the filteringFactor property. Smoothed values are averaged over several frames and responds barely to sudden changes of motion (eg shaking or dropping the device).
property -
instantaneousXInstantaneous acceleration value obtained from a high-pass filter. This value approximates the instant motion of the device with the constant effect of gravity filtered out, and reacts strongy to sudden changes of motion (eg shaking or dropping the device). Value is already transformed to current device orientation.
property -
instantaneousYInstantaneous acceleration value obtained from a high-pass filter. This value approximates the instant motion of the device with the constant effect of gravity filtered out, and reacts strongy to sudden changes of motion (eg shaking or dropping the device). Value is already transformed to current device orientation.
property -
instantaneousZInstantaneous acceleration value obtained from a high-pass filter. This value approximates the instant motion of the device with the constant effect of gravity filtered out, and reacts strongy to sudden changes of motion (eg shaking or dropping the device).
property -
filteringFactorThe filtering factor used for high & low pass filtering. Determines how strongly raw values affect the filtered acceleration values. A filteringFactor of 0.1f means that only 10% of the raw values per update will be added to the running acceleration values. In other words the values are smoothed out over 10 updates (frames).
property -
– resetSets all acceleration values to 0, including internal states. Call this method after an interruption in your application, for example the pause menu or starting a new level.
-
– setAccelerationWithTimestamp:x:y:z:
Properties
filteringFactor
The filtering factor used for high & low pass filtering. Determines how strongly raw values affect the filtered acceleration values. A filteringFactor of 0.1f means that only 10% of the raw values per update will be added to the running acceleration values. In other words the values are smoothed out over 10 updates (frames).
@property (nonatomic) double filteringFactorDeclared In
KKAcceleration.hinstantaneousX
Instantaneous acceleration value obtained from a high-pass filter. This value approximates the instant motion of the device with the constant effect of gravity filtered out, and reacts strongy to sudden changes of motion (eg shaking or dropping the device). Value is already transformed to current device orientation.
@property (nonatomic, readonly) double instantaneousXDeclared In
KKAcceleration.hinstantaneousY
Instantaneous acceleration value obtained from a high-pass filter. This value approximates the instant motion of the device with the constant effect of gravity filtered out, and reacts strongy to sudden changes of motion (eg shaking or dropping the device). Value is already transformed to current device orientation.
@property (nonatomic, readonly) double instantaneousYDeclared In
KKAcceleration.hinstantaneousZ
Instantaneous acceleration value obtained from a high-pass filter. This value approximates the instant motion of the device with the constant effect of gravity filtered out, and reacts strongy to sudden changes of motion (eg shaking or dropping the device).
@property (nonatomic, readonly) double instantaneousZDeclared In
KKAcceleration.hrawX
Raw acceleration in G’s along the x axis. Value is already transformed to current device orientation.
@property (nonatomic, readonly) double rawXDeclared In
KKAcceleration.hrawY
Raw acceleration in G’s along the y axis. Value is already transformed to current device orientation.
@property (nonatomic, readonly) double rawYDeclared In
KKAcceleration.hrawZ
Raw acceleration in G’s along the z axis.
@property (nonatomic, readonly) double rawZDeclared In
KKAcceleration.hsmoothedX
Smoothed value using a low-pass filter influenced by the filteringFactor property. Smoothed values are averaged over several frames and responds barely to sudden changes of motion (eg shaking or dropping the device). Value is already transformed to current device orientation.
@property (nonatomic, readonly) double smoothedXDeclared In
KKAcceleration.hsmoothedY
Smoothed value using a low-pass filter influenced by the filteringFactor property. Smoothed values are averaged over several frames and responds barely to sudden changes of motion (eg shaking or dropping the device). Value is already transformed to current device orientation.
@property (nonatomic, readonly) double smoothedYDeclared In
KKAcceleration.hsmoothedZ
Smoothed value using a low-pass filter influenced by the filteringFactor property. Smoothed values are averaged over several frames and responds barely to sudden changes of motion (eg shaking or dropping the device).
@property (nonatomic, readonly) double smoothedZDeclared In
KKAcceleration.h