Forum Discussion
Anonymous
4 years agoNot applicable
getting the correct geometry after guardian refresh - seems to require a delay
I'm working on a roomscale game that requires accurate incorporation of the guardian as well as tracking any changes immediately. A while back I posted here about getting guardian updates and I g...
pixelplacement
4 years agoProtege
Any chance you could share how you have been able to get GetGeometry to give you anything at all? I've been banging my head against this for a few days without success. And yes, I have run this call on Quest 2 directly and not just through Link. Thanks for any input!
- Anonymous4 years agoNot applicable
This is probably not buildable, I pulled a bit from here and a bit from there, but hopefully it will give you the idea.
Feel free to ask any followups and good luck!!
Damon
Vector3 playAreaSize;
bool originReady = false;
bool configured = true;
bool done = false;
void CheckOriginMode()
{
TrackingOriginModeFlags tomFlags;
List<XRInputSubsystem> subsystems = new List<XRInputSubsystem>();
SubsystemManager.GetInstances<XRInputSubsystem>(subsystems);
if (subsystems.Count == 0)
{
return;
}
originReady = true;
for (int i = 0; i < subsystems.Count; i++)
{
subsystems[i].TrySetTrackingOriginMode(TrackingOriginModeFlags.Floor);
}
}
void GetPoints () {
configured = OVRManager.boundary.GetConfigured();
if (configured)
{
//Grab all the boundary points. Setting BoundaryType to OuterBoundary is necessary
boundaryPoints = OVRManager.boundary.GetGeometry(OVRBoundary.BoundaryType.PlayArea);
if (boundaryPoints == null || boundaryPoints.Length == 0)
{
return;
}
playAreaSize = OVRManager.boundary.GetDimensions(OVRBoundary.BoundaryType.PlayArea);
done = true;
}
}
void GetBoundary () {
CheckOriginMode ();
if ( !originReady ) {
return;
}
GetPoints ();
if ( done ) {
doWhatever ();
}
}
- Anonymous4 years agoNot applicable
I just noticed the comment about OuterBoundary. That actually refers to a previous version. I use PlayArea now which returns the 4 points of the largest rectangle contained within the guardian. I switched to that because that was better for my game than dealing with the much larger set of points that comes from using OuterBoundary.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 years ago