Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
cloud_canvas's avatar
cloud_canvas
Expert Protege
7 years ago

Offset recenter forward vector?

Hi there,
I'm trying to figure out if there's some kind of way to offset the yaw (Y axis) rotation of the forward vector for a system-level recentering operation, either through the Oculus API or via something like UnityEngine.XR.xxx.
The following graphic is a bird's eye view of the different hotspots in the main area of our app, with
their respective forward directions relative to "north". Forgive the MSPaint...

You spawn into this area in location A. If you were to look behind you and to your right and click on the hotspot to go to location D, you'd be facing the right way because you already had to turn right to look at it.
The issue is that when an OVRManager.HMDMounted/HMDUnmounted cycle inevitably happens on the Go, OR the user does a long press on the Oculus button on their Go controller and forces a recenter, if you're standing in locations D or E, you're now facing Y+0 degrees again instead of Y+/-90 degrees.
The app naturally has events for when the user teleports to different locations around the room, so ideally I'd simply be able to take the transform rotation of the GameObject that represents that hotspot location and plug it in as an offset to the rotation of the recenter direction.
The first part of this is figuring out where I can latch onto an event when the app is recentered.
Per some previous discussions, I've tried to latch onto OVRDisplay's Action called RecenteredPose, but it doesn't seem to be firing off, in either case of an unmount/remount loop, or from long pressing the Oculus button on the Go controller. Where in the Oculus Utilities SDK can I find an Event that describes either of these recentering operations?
Secondly there is my core question. Is there like a Vector3 that I can update somewhere (similar to OVRManager.headPoseRelativeOffsetRotation which appears to be only be used for the recently-introduced in-Editor headset emulation stuff, but not quite the same thing) to adjust the default recenter forward position, either in the Oculus SDK or in UnityEngine.XR stuff? I don't want to negate the recentering action itself like some of the posts I linked to, I just want to change which direction it's facing when just a recenter happens, depending on some scripting logic about which hotspot I'm at in my environment.

Thanks!