// Update is called once per frame void Update() { vrTracker tracker = null; vrKeyboard keyb = null; if (MiddleVR.VRDeviceMgr != null) { tracker = MiddleVR.VRDeviceMgr.GetTracker(Tracker); keyb = MiddleVR.VRDeviceMgr.GetKeyboard(); } if (keyb != null && keyb.IsKeyToggled(MiddleVR.VRK_SPACE)) { if (tracker != null) { float yaw = tracker.GetYaw(); vrQuat neutralOr = new vrQuat(0, 0, 0, 1); neutralOr.SetEuler(-yaw, 0, 0); vrQuat nq = neutralOr.GetInverse(); tracker.SetNeutralOrientation(nq); } } }
protected void Update() { vrTracker tracker = null; vrKeyboard keyboard = null; var deviceMgr = MiddleVR.VRDeviceMgr; if (deviceMgr != null) { tracker = deviceMgr.GetTracker(Tracker); keyboard = deviceMgr.GetKeyboard(); } if (keyboard != null && keyboard.IsKeyToggled(MiddleVR.VRK_SPACE)) { if (tracker != null) { float yaw = tracker.GetYaw(); vrQuat neutralQ = new vrQuat(); neutralQ.SetEuler(-yaw, 0.0f, 0.0f); vrQuat invNeutralQ = neutralQ.GetInverse(); tracker.SetNeutralOrientation(invNeutralQ); } } }
// Update is called once per frame void Update() { vrTracker tracker = null; vrKeyboard keyb = null; if (MiddleVR.VRDeviceMgr != null) { tracker = MiddleVR.VRDeviceMgr.GetTracker(Tracker); keyb = MiddleVR.VRDeviceMgr.GetKeyboard(); } if (keyb != null && keyb.IsKeyToggled(MiddleVR.VRK_SPACE)) { if (tracker != null) { tracker.SetNeutralOrientation(tracker.GetOrientation()); } } }