I am using the XR Interaction Toolkit with the Oculus Plugin in Unity 2019.4, building to the Oculus Quest.
To teleport the player, I use:
XRRig.MoveCameraToWorldLocation(Vector3 desiredWorldLocation) to set their position, and
XRRig.MatchRigUpCameraForward(Vector3 destinationUp, Vector3 destinationForward) to set their rotation
This works all well and good. However, if the player attempts to re-center themselves by simultaneously holding the oculus button and the menu button, their position is indeed re-centered on the last teleportation position (which is what I expect), but the orientation (rotation) is off 100% of the time. The player always seems to be rotated ~100 degrees to the left of the intended forward vector. Repeated re-centers afterward do not add additional rotation but continue to reset to this incorrect orientation, instead of matching the up and forward vectors specified in the function.
A workaround might be:
1.) figure out exactly how many degrees off a post-teleport re-centered pose is from the initial teleport pose
2.) hard code this value and compensate for this upon teleporting
3.) after teleporting, rotate the player back x degrees to face the intended direction, thereby fooling future re-centers into actually having the player face the intended direction.
Tomfoolery and trickery to be sure. Is there any way I can avoid writing this silly code? Am I missing something?