Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Did (Oculus) just introduced a Reset HMD bug in latest update? 4.20 and 4.21 [SOLVED]

OlivierJTOlivierJT Posts: 190 Oculus Start Member
edited April 2019 in Unreal Development
Hello everyone, hello Oculus team,

I am having a serious re-calibration issue with Oculus latest build from Github:

UE4 4.20.3 Oculus VR Git.
Steps to reproduce are simple: use "reset orientation and position" node on an input.
Use it: Camera position goes into the floor

Same project, duplicated for testing:
On 4.20.1   4.20.3 Standard UE4 build (from Git): normal behavior
On 4.20.1   4.20.3 OVR UE4 build (from Git): Camera goes to the Floor

I do use set tracking origin etc... it all worked so far, I demoed the same project on "4.20.1 OVR git" at OC5 it was working as intended.
The bug happened after the recent "oculus Software" update (I mean the oculus "app/store consumer launcher")

It is not working as intended anymore.

Can you confirm this please?
Until then I am back to non OVR version.

Thank you.


  • rpalandrirpalandri Posts: 63 Oculus Staff
    Hi. This is my bug. Thanks for finding it. The main issue was us just trying to implement recentering in the engine instead of having half in the engine / half in the runtime, and failing to account for the differences between eye-level recentering (which works) and floor level recentering (which doesn't). 

    In OculusHMD.cpp, you have 2 functions, FOculusHMD::ResetOrientationAndPosition and FOculusHMD::ResetPosition which both modify Settings->BaseOffset. After this line, modifying BaseOffset :

    Settings->BaseOffset = ToFVector(poseState.Pose.Position);
    Please add:
    const bool floorLevel = GetTrackingOrigin() == EHMDTrackingOrigin::Floor;
    If you don't care about eye-level tracking space you can just put Settings->BaseOffset.Z=0; 

  • OlivierJTOlivierJT Posts: 190 Oculus Start Member
    Thank you Remi! It all works perfectly now.

    By the way, talking about reset HMD:
    With Vive the "center of the play room" is used so when you start it knows where it is and you can do things with it.
    On Rift that "center" is not accessible (That I know of), I can see it when I use in Oculus app the "recalibrate height" : it draws a "circle on the floor" in the "center of the play room".

    So is there a way to have that "circle on the floor" position? Or being able to reset using it?
    The idea for me behind this is to tell/force the player when he start the game to: "go back to the center of the room"

  • AlexotronicAlexotronic Posts: 34 Oculus Start Member
    @OlivierJT Check out RoboRecall mod kit for an example of this. (From what I recall the position of the HMD is fed into a material parameter collection, compared with origin location, and a circle is faded in if player is too far away from origin)
  • Mohammed_hashimMohammed_hashim Posts: 94 Oculus Start Member
    edited December 2018
    @rpalandri @imperativity
    Hi, could you guys confirm this issue is fixed on Oculus github 4.21 version? since i looked at the code on github and seems the base offset already set to "0".


  • Mohammed_hashimMohammed_hashim Posts: 94 Oculus Start Member
    @imperativity Any update please about this issue pelase, is it solved on latest UE4 version or still? since i faced same problem even though i tested it with Oculus github version 4.21.

  • lucasabbadiniarlucasabbadiniar Posts: 4
    Dear Oculus staff,
    I'm facing the same issue @OlivierJT faced, I've tried to solve it by modifying the OculusHMD.cpp file
    (Program Files\Epic Games\UE_4.21\Engine\Plugins\Runtime\Oculus\OculusVR\Source\OculusHMD\Private) without success.
    I am not expert in this kind of stuff and I don't know how to code.
    Would it be possible for you to explain me in detail what I should do? Or send me the fixed OculusHMD.cpp file so I can just paste it?
    This is what I've tried to do:


    Settings->BaseOffset = ToFVector(poseState.Pose.Position);
    const bool floorLevel = GetTrackingOrigin() == EHMDTrackingOrigin::Floor;
    if(floorLevel) {
        Settings->BaseOffset.Z = 0;


    Settings->BaseOffset = ToFVector(poseState.Pose.Position);
                Settings->BaseOffset.Z = 0;

    I'm working on UE4 4.21.2, oculus app version
    Thanks for your time,

  • OlivierJTOlivierJT Posts: 190 Oculus Start Member

    Hey guys, It's April... and I just updated to 4.21........ and @rpalandri hasn't correct the code that was for 4.21 also.......!
    You have to apply the same fix AGAIN, 7 months after for me...
    I mean come on...

    I haven't updated to 4.22 yet (just released), I won't until 4.22.1 :p

    So @lucasaguirre sorry about the super late reply, strangely I didn't get any notification of this post.
    Still having the issue?

    I don't code either, but this is text editing.
    @rpalandri modification is working.

    You need to have build your own UE4 (get it via Git and follow the building process until you reach the VStudio part.
    You can even once it's built got back to it and do corrections so no worries, you don't have to rebuild all over again.

    After the Remi modification it should look exactly like this in your "OculusHMD.cpp"
    	void FOculusHMD::ResetOrientationAndPosition(float yaw)
    Then "build solution"
    It will build just the Oculus module and be like less than 5mn.
    (250s for me)


  • emre_tanirganemre_tanirgan Posts: 21 Oculus Start Member
    Just wanted to chime in here and say that you don't actually have to modify the UE4 source to fix this. I was able to get around the issue by adding a VRNotifications component, and doing this in my HMDRecentered Delegate (I'm using the floor level as my tracking origin in my app): 

    It essentially does the same thing as the fix does, may be a little less clean but doesn't require a custom Unreal build! Though my hope is that Oculus will have integrated this fix soon to an official Unreal release, because it seems like a pretty important and fundamental feature is broken without it. Hope this helps!
Sign In or Register to comment.