Skip to main content
Participant
July 14, 2016

OVRDisplay.ResetPose only works for yaw?

Hello everyone, 

for a research paradigm, we are giving our participants a DK2 HMD. We want them to be immersed in the experiment, hence the HMD. Because we have the Camera OBJ drive a preconfigured path, we do not want them to be able to look around. After lots of try and error, we figured that calling OVRDevice.ResetDisplay in Update() helps, but only "disables" the movement for one axis, but we need it for all three.

Is that the intended behaviour or is it possible that the path-generator iTween interferes?

Could it help calling ResetPose on OVRPlayercontroller?

Any help greatly appreciated.

Thanks
/seb

7 replies

Inspiring
July 14, 2016
What engine are you working within?  Unity/Unreal or other?
Inspiring
July 14, 2016
Yes, this is the intended behavior. The point of that function call is to reset the forward looking direction (in yaw only) as the user may have turned their seat or be facing in a different direction. Pitch and roll should always be taken directly from the headset orientation, as setting it otherwise causes discomfort.

I would actually recommend you DO NOT disable head-tracking as this will cause discomfort for users. However, if you must, you can place the camera as a child of an empty GameObject, and on the parent Update set it's position/orientation to the inverse of the camera.

The code looks like this:

using UnityEngine;
using System.Collections;

public class DisableTracking : MonoBehaviour {
private Camera cam;
private Vector3 startPos;

void Start () {
cam = GetComponentInChildren<Camera>();
startPos = transform.localPosition;
}

void Update () {
transform.localPosition = startPos - cam.transform.localPosition;
transform.localRotation = Quaternion.Inverse(cam.transform.localRotation);
}
}


AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
Participant
July 15, 2016
Thank you so much cyberreality, it was the local rotation that we were missing. You saved my weekend!
Participant
October 7, 2016
Is it possible to do this for two axes only as well? 

I tried: 

Quaternion inverse = Quaternion.Inverse(cam.transform.localRotation);
Quaternion newRotation = new Quaternion(inverse.x, InputTracking.VRNode.Head.localRotation.eulerAngles.y, inverse.x, inverse.w);
transform.localRotation = newRotation.

However, this induces drift and, top of all, does not work anyway.


We would like to constrain movement of the Oculus to the horizontal axis. 

Help is, as always, greatly appreciated.

Thanks!
Inspiring
October 7, 2016
Yes, you can to that, though I don't recommend it. It will make people very uncomfortable. Your issue is that you can't replace Quaternion elements with Euler angles. They are completely different concepts.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
Participant
October 17, 2016
Hmm, doas this commands working with Rift CV1 also?!
Participant
October 26, 2016
Cybereality, 

the blocking of the HMD axis in only two of three axis does not seem to work in a build, only in the editor. Is there a way I can check build logs or anything that would allow me to see what's going on?

With best regards
Seb