Skip to main content
New Participant
August 13, 2016

Oculus Unity - Reset Pose , without resetting the rotation

I am working on a VR game using Oculus Rift utlities plugin 1.6.0 (https://developer.oculus.com/downloads/game-engines/1.6.0/Oculus_Utilities_for_Unity_5/) and Unity 5.4.0f3.

The biggest problem I am currently facing is with the player reset position.
So basically if the player moves back beyond a particular direction or moves into a wall, then the head gets snapped back to the root origin of the OvrPlayerController(root) Object.
Please refer to this video link for better understanding of the functionality.
(https://www.dropbox.com/s/t208phk2bg6rhe5/adrift.mp4?dl=0)

I am trying to achieve this using `OVRManager.display.RecenterPose();`
which looks like this 

    public void RecenterPose()
    {
        VR.InputTracking.Recenter();
    
        if (RecenteredPose != null)
        {
             RecenteredPose();
        }
    }

This works fine the head gets snapped back to the origin (root position). But this also resets the rotation which looks a weird. Is there an alternate path to just reset the position leaving the rotation as it is ??
This topic has been closed for replies.

4 replies

Inspiring
August 14, 2016
First, this should be in the Developer forum in the Unity section. You can switch forums using the drop-down menu on the top-right. I'll move it though.

To answer your question, the Recenter function should not be used like that. That function is used so the player can calibrate where they want the center of the world, and their forward direction to be located in. It should not be used for game specific functions, like clipping geometry or collision.

Additionally, moving the player's head position automatically, like due to touching a wall, will cause discomfort and disorientation. If your goal is to avoid the player looking though walls, then it is better to fade the screen black or display some sort of warning message instead.
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
HashBuoyAuthor
New Participant
August 14, 2016
Hey , thanks for moving it to the appropriate thread.
I agree to the fact that it will create discomfort to the player and is not a good solution.
But this scenario doesn't occur too often, and we really need this to maintain impressiveness in the game.
Also the video reference for this functionality is from the game called 'Adrift' (link: https://www.youtube.com/watch?v=KxMpadZIMQQ ).
If there is any way to achieve this , then please let me know.
Thanks
Inspiring
August 15, 2016
Rather than calling RecenterPose, try moving OVRCameraRig.trackingSpace.position. For example, you could set myRig.trackingSpace.position = myRig.centerEyeAnchor.position to reset the position but not the orientation.
HashBuoyAuthor
New Participant
August 15, 2016
Hey , that was pretty close . It set me up on the right path , i tweaked the formula a bit 
myRig.trackingSpace.position = myRig.trackingSpace.position - myRig.centerEyeAnchor.localPosition ;

This works but not in best sense for some reason, rotation is off beat .
Anyways thanks for helping , will figure out something.