cancel
Showing results for 
Search instead for 
Did you mean: 

OVRBoundary.GetGeometry(...) sometimes causing an error

Criterium
Honored Guest
Some of our users have reported the following error (taken from output.log) when we try to access OVRManager.boundary.GetGeometry(OVRBoundary.BoundaryType.OuterBoundary):

ArgumentNullException: Argument cannot be null.
Parameter name: src
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:copy_from_unmanaged (intptr,int,System.Array,int)
at System.Runtime.InteropServices.Marshal.Copy (IntPtr source, System.Single[] destination, Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0 
at OVRBoundary.GetGeometry (BoundaryType boundaryType) [0x00000] in <filename unknown>:0 


Which leads to our game crashing.
What could be causing this error and how could we avoid it?

These are the current versions of Unity and all Oculus related stuff:
Unity v5.5.0f3, Oculus Utilities v1.9.0, OVRPlugin v1.10.0, SDK v1.13.0.
5 REPLIES 5

kersk
Meta Employee
Heya, thanks for reporting this.

It looks like this occurs when a user does not have a boundary configured through the Oculus setup process. This results in a 0 point boundary, which then leads to the null ref here when we're trying to Marshal.Copy data from IntPtr.Zero. This will be fixed in the next release, Oculus Utilities v1.15.0. You should also be able to work around this in v1.9.0 by checking if the user's boundary is configured first, like this:

if (OVRManager.boundary.GetConfigured())
{
Vector3[] points = OVRManager.boundary.GetGeometry(OVRBoundary.BoundaryType.OuterBoundary);

}

Criterium
Honored Guest
Wonderful. Thanks for the quick answers!

Criterium
Honored Guest
One short follow up question. Is it possible to reset the boundaries configured in the Guardian System so it is unconfigured? I wanted to re-produce this bug by emulating a user that hasn't configured his boundaries.

I've tried reinstalling the Oculus client and deleting all Oculus related folders to no avail, the boundaries in the Guardian System are always configured when I boot up the Oculus client.

kersk
Meta Employee
In the desktop Oculus app, go to Settings -> Devices -> Configure Rift -> Sensor Setup. Then proceed through until the first screen asking to setup the boundaries and then select skip. The earlier sensor setup phase wipes out any existing boundaries, and then skipping out of the boundary config phase early leaves them unconfigured.

Criterium
Honored Guest
Again, thanks for the swift answer.
Was able to reset the boundaries as you described and re-produce the bug.