Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Trying to get boundary data on Oculus Quest

Discussion in 'AR/VR (XR) Discussion' started by Hammarby, Feb 18, 2020.

  1. Hammarby

    Hammarby

    Joined:
    Jan 15, 2019
    Posts:
    2
    Hi, as it says in the title, I'm trying to get the Guardian data from oculus quest during runtime in the HMD.
    I'm using Unity 2019.3 and been trying with booth OVRBoundary.GetGeometry() and XRInputSubsystem.tryGetBoundaryPoints(Vector3[]), nothing seems to work.
    Oculus dev page say that they are static but in Visual Studio I get that it is a non-static (if that makes any sense?).

    It looks simple enough here https://frl.nyu.edu/obtain-guardian-boundaries-on-quest/ but I just cannot make it happen, any ideas anyone?
     
  2. humansteak

    humansteak

    Joined:
    Feb 4, 2016
    Posts:
    25
  3. Hammarby

    Hammarby

    Joined:
    Jan 15, 2019
    Posts:
    2
  4. miik2

    miik2

    Joined:
    Aug 23, 2018
    Posts:
    5
    What Version do you use exactly?
     
  5. koniouchine

    koniouchine

    Joined:
    Mar 3, 2018
    Posts:
    5
    I've managed to get the boundary data using the following method
    Code (CSharp):
    1.  
    2. public GameObject wallMarker;
    3.  
    4. //Check if the boundary is configured
    5. bool configured = OVRManager.boundary.GetConfigured();
    6.  
    7.         if (configured)
    8.         {
    9.             //Grab all the boundary points. Setting BoundaryType to OuterBoundary is necessary
    10.             Vector3[] boundaryPoints = OVRManager.boundary.GetGeometry(OVRBoundary.BoundaryType.OuterBoundary);
    11.          
    12.              //Generate a bunch of tall thin cubes to mark the outline
    13.             foreach (Vector3 pos in boundaryPoints)
    14.             {        
    15.                 Instantiate(wallMarker, pos, Quaternion.identity);
    16.             }
    17.         }
     
    JoeStrout likes this.
unityunity