Closed brendanwalker closed 5 years ago
Thanks @brendanwalker, have reviewed, and this was overlooked during the re-implementation of the Motion Controller features - are you happy for me to integrate these to the code base similar to a Pull Request?
Yeah totally happy! Thanks for taking a look.
Thanks Brendan! I've published develop-4.21 with your revisions included, comment link to this GitHub issue at Tick().
Can you check from your end please before I start propagating to other branches (min ver for this is 4.18 as far as I can tell)
@brendanwalker - quick nudge :) If you can do a finally verification please on your end before I propagate PR to main branches.
Cheers
Added in internal branches. Will be in 0.6 release.
Apologies if I should have posted about this in the Discord channel first. Since this is a bit long winded I figured posting an issue made more sense:
If you use the XRSystem's ResetOrientationAndPosition call the BaseOrientation and BasePosition state are set. This call is used in "Moss" every time we transition to a new room and want to recenter on the room's camera. The FSteamVRHMD::PoseToOrientationAndPosition function is used to apply the inverse of the BaseOrientation and BasePosition to the controller pose.
I was expecting to see the same application here: https://github.com/ValveSoftware/steamvr_unreal_plugin/blob/4.21/SteamVRInput/Source/SteamVRInputDevice/Private/SteamVRInputDevice.cpp#L664-L669
I was able to work around this by adding the following state to FSteamVRInputDevice:
Then caching those values in Tick:
And then finally using those values in FSteamVRInputDevice::GetControllerOrientationAndPosition():
If I'm not mistaken, we need to cache the values in Tick since GetControllerOrientationAndPosition() can be called in the render thread as part of the MotionControllers LateUpdate.