Browse Source

Fixing magnetometer on iOS

(cherry picked from commit 4b7d1d8c15747a552b7dff52b0eeda4d3e7cec4e)
BastiaanOlij 8 years ago
parent
commit
a0b0dff6fd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      platform/iphone/app_delegate.mm

+ 2 - 2
platform/iphone/app_delegate.mm

@@ -299,8 +299,8 @@ static int frame_count = 0;
 	if (!motionInitialised) {
 	if (!motionInitialised) {
 		motionManager = [[CMMotionManager alloc] init];
 		motionManager = [[CMMotionManager alloc] init];
 		if (motionManager.deviceMotionAvailable) {
 		if (motionManager.deviceMotionAvailable) {
-      motionManager.deviceMotionUpdateInterval = 1.0/70.0;
-      [motionManager startDeviceMotionUpdates];			
+			motionManager.deviceMotionUpdateInterval = 1.0/70.0;
+                        [motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXMagneticNorthZVertical];
 			motionInitialised = YES;
 			motionInitialised = YES;
 		};
 		};
 	};
 	};