Skip to main content
New Participant
May 19, 2021

Event or Callback for player exiting Guardian

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.

    This topic has been closed for replies.

    3 replies

    New Participant
    May 24, 2021

    *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.

    New Participant
    May 25, 2021

    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.

    May 30, 2021

    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.