05-19-2021 10:24 AM
Hello! I'm looking for an event or callback for when the player exits (or re-enters) the Guardian. I can't seem to find anything relevant in the documentation reference.
In my game, the player configures the in-game environment to their guardian. When the player exits the Guardian accidentally and then re-enters, the in-game environment doesn't align with their guardian anymore. I need to tell them to redo the alignment.
It did occur to me that I could use OVRBoundary.TestPoint and test against my user's head, but I'm not excited about manually polling that every frame *and* I don't want to worry about false negatives.
05-24-2021 11:08 AM - edited 05-24-2021 11:41 AM
*edit* Just kidding, OVRManager.AllowRecenter does not do what I'd hoped, and now I have no idea what it's supposed to do. I'll be exploring OVRPlugin.GetLocalTrackingSpaceRecenterCount next.
It happens that I was able to solve this issue for my game by setting OVRManager.AllowRecenter to FALSE. Setting it to TRUE causes the game to attempt to realign to the player after re-entering the guardian, but I didn't want that. By setting it to FALSE, when the player walks around outside the guardian and re-enters, they're exactly where they should be.
I believe you could use OVRPlugin.GetLocalTrackingSpaceRecenterCount to create an event or callback in the way I originally hoped, but I didn't get around to testing it. That path is left as an exercise to the reader.
05-25-2021 09:23 AM
I found that OVRManager.display.RecenteredPose will generate a callback for exactly the situation I need, BUT, it also generates a callback when the player manually resets their view, which isn't ideal for my purposes.
I also tried monitoring OVRPlugin.GetLocalTrackingSpaceRecenterCount() but that seems to also increment when the player manually resets the view.
05-30-2021 11:05 AM
I think another user was trying something similar recently and they got the results they desired by switching "Tracking Origin Type" to "Stage" in the OVRManager.