I have an old iOS app that doesn't use GoogleVR, instead it rolls it's own VR framework, but once I upgraded to iOS 14 the data coming from CMMotionManager is very wobbly, or shaky, even if I place the phone flat on a table. Am I doing something wrong or do I need to use a different way to access the data? I've seen the Official Google VR team state they had to fix a similar issue, but I'm unable to find their changes, since it is buried inside compiled code for their Unity Plugin.
The code in question is at: https://github.com/mgatelabs/SCN-VR/blob/master/scn-vr/CoreMotionTracker.m
But the main parts would be as follows
But i'm starting the process with:
And then i'm reading and transforming the data like this:
And it is all wobbly, which isn't that great for VR.
The code in question is at: https://github.com/mgatelabs/SCN-VR/blob/master/scn-vr/CoreMotionTracker.m
But the main parts would be as follows
But i'm starting the process with:
Code Block language [self.motionManager startDeviceMotionUpdatesUsingReferenceFrame: CMAttitudeReferenceFrameXArbitraryZVertical];
And then i'm reading and transforming the data like this:
Code Block language CMQuaternion currentAttitude_noQ = self.motionManager.deviceMotion.attitude.quaternion; GLKQuaternion baseRotation = GLKQuaternionMake(currentAttitude_noQ.x, currentAttitude_noQ.y, currentAttitude_noQ.z, currentAttitude_noQ.w); GLKQuaternion rotationFix = GLKQuaternionMakeWithAngleAndAxis(-M_PI_2, 0, 0, 1); if (self.landscape) { self.orientation = GLKQuaternionMultiply(baseRotation, rotationFix); } else { self.orientation = GLKQuaternionMultiply(rotationFix, baseRotation); }
And it is all wobbly, which isn't that great for VR.