#import <SENSiOSOrientationDelegate.h>
Inherits NSObject.
Definition at line 4 of file SENSiOSOrientationDelegate.h.
◆ init
◆ onDeviceMotionUpdate:
| - (void) onDeviceMotionUpdate: |
|
(CMDeviceMotion*) |
motion |
|
|
implementation |
Definition at line 11 of file SENSiOSOrientationDelegate.mm.
86 :(CMDeviceMotion*)motion
89 CMAttitude* attitude = motionData.attitude;
93 CMQuaternion q = attitude.quaternion;
106 GLKQuaternion qNWU = GLKQuaternionMake(q.x, q.y, q.z, q.w);
107 GLKQuaternion qRot90Z = GLKQuaternionMakeWithAngleAndAxis(GLKMathDegreesToRadians(90), 0, 0, 1);
108 GLKQuaternion qENU = GLKQuaternionMultiply(qRot90Z, qNWU);
112 _updateCB(qENU.q[0], qENU.q[1], qENU.q[2], qENU.q[3]);
◆ start
◆ startMotionManager:
| - (void) startMotionManager: |
|
(double) |
intervalTimeSEC |
|
|
implementation |
Starts the motion data update if the interval time > 0 else it stops.
Definition at line 11 of file SENSiOSOrientationDelegate.mm.
61 :(double)intervalTimeSEC
72 [_motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXMagneticNorthZVertical
73 toQueue:[NSOperationQueue currentQueue]
74 withHandler:^(CMDeviceMotion* motion, NSError* error) {
75 [
self performSelectorOnMainThread:@selector(onDeviceMotionUpdate:)
82 [_motionManager stopDeviceMotionUpdates];
◆ stop
◆ _motionManager
| - (CMMotionManager*) _motionManager |
|
private |
◆ _running
◆ updateCB
| - (function<void(float, float, float, float)>) SENSiOSOrientationDelegate: |
|
readwritenonatomicassign |
The documentation for this class was generated from the following files: