Override Oculus Orientation 5.3

So with the new VR support the main camera’s transform is being overridden with the Oculus transform.

I kinda get this in a general use case but I need to able to override this behaviour.

Specifically I want to override the orientation so that the real world Oculus orientation maps to a greater in-game orientation, particularly on the local y-axis i.e. when I turn my head 90 degrees in the real world, I want to be facing 180 degrees in game.

This is something I have done before in VR on other engines and is a critical part of many locomotion systems you’ll see being used.

So how do I go about this, I understand I could always child the camera to a parent and then rotate the parent using the Oculus orientation as a base but this is messy and a bit of a quaternion nightmare.

Took a few minutes to figure out, but in case anyone in posterity is curious, here’s how:

The OVRPlugin class has boolean properties for both position and rotation. Setting these properties in turn calls methods in the oculus plugin itself to enable and disable the position and orientation tracking. Setting rotation in OVRPlugin to false (or, more tediously, getting a reference to the oculus plugin and calling its method: ovrp_SetTrackingOrientationEnabled(false)) will disable rotation transformations from being applied to the camera in Unity.

You can find this at lines 425-435 of the OVRPlugin.cs script that comes in that unitypackage.

The above is true for version 1.8 of Oculus Utilities for Unity 5.

(In retrospect, I realize I’m not 100% answering the question of the OP, as I’m not intercepting the rotation values, but rather disabling them entirely (which is what I needed for my own purpose)).