01-24-2017 10:43 AM
01-25-2017 10:55 AM
Hi firstly thanks for replying. It's been driving me nuts this problem, great to have support. 😉
imperativity said:
Transform.localRotation
is a quaternion. Please use euler Angles to convert it to the XYZ rotation you are expecting for this activity.
01-25-2017 11:49 AM
Quaternion quatStable = Quaternion.Euler( transform.localRotation.eulerAngles);
Debug.Log ("this is unreliable " + transform.localRotation + " that is reliable " + quatStable );
helicopter.VRInputYaw (quatStable.y * yawTwistAmount);
01-26-2017 04:36 AM
Thanks but that's for rotating a gameObject itself. All I wanted is a reading of the localRotation of the controllers to be reliable, a value of Y inverting from -1 to 1 on spawn randomly is impossible to code with. My method above in the end suffered very bad gimbal lock issues. Unity does something strange internally. Basically using eulerAngles will always present gimbal lock values that jump. When I used the eulerAngles from localRotation to create a new Quaternion it suffered from very bad jumps from the locking as it was based from eulerAngles XYZ.
imperativity said:
I did some quick followup research and found this unity thread here:
http://answers.unity3d.com/questions/573035/avoiding-gimbal-lock.html
A developer there stated this about a similar issue:
Transform.RotateAround
, you don't even need to bother going into Quaternions, though you can also do it withQuaternion.AngleAxis
on each axis and multiplying them together (quaternion multiplication applies each rotation in turn).
Quaternion quatStable = Quaternion.Euler( transform.localRotation.eulerAngles);
if (quatStable.y != transform.localRotation.y) { // sometimes polar opposite
helicopter.VRInputYaw (transform.localRotation.y * yawTwistAmount * -1);
} else {
helicopter.VRInputYaw (transform.localRotation.y * yawTwistAmount);
}
01-26-2017 03:35 PM
02-09-2017 04:44 AM
Hey thanks for all the info. I shall check out the configuration of my setup. I got a little busy recently so I've not had a chance to get into the Touch setup. That information you provided is really helpful and I think I follow your suggestions. I must admit Quaternions were not my strong point but I have done my studies recently and think I will be able to crack it now. I'll ping back if I have troubles, hopefully not 🙂 thank you.
This shouldn't happen when Touch is set up properly. How many sensors are you using? Are they plugged into USB 2 or USB 3 ports? Do all of the sensors report that they're healthy in the Oculus desktop app?