using UnityEngine;
namespace Unity.XR.Oculus
{
///
/// Accessors for the XR Boundary system.
///
public static class Boundary
{
///
/// Enumerates the defined boundary types.
///
public enum BoundaryType
{
///
/// Outer Boundary - axis-aligned rectangular bounding box enclosing the outer boundary.
///
OuterBoundary = 0,
///
/// Play area - axis-aligned smaller rectangle area inside outer boundary where gameplay happens.
///
PlayArea = 1
}
///
/// Indicates whether the Boundary has been configured.
///
/// True if the boundary system is currently configured with valid boundary data.
public static bool GetBoundaryConfigured()
{
return NativeMethods.GetBoundaryConfigured();
}
///
/// Get a vector of the spatial dimensions of the specified boundary type. (x = width, y = height, z = depth) with height always returning 0.
///
/// The type of boundary from which to request dimensions.
/// The size of the boundary.
/// true if boundary dimensions are supported and values are available. Return false otherwise.
public static bool GetBoundaryDimensions(BoundaryType boundaryType, out Vector3 dimensions)
{
return NativeMethods.GetBoundaryDimensions(boundaryType, out dimensions);
}
///
/// Is the Boundary volume visible?
///
/// true if the boundary system is currently visible. Return false otherwise.
public static bool GetBoundaryVisible()
{
return NativeMethods.GetBoundaryVisible();
}
///
/// Requests that the boundary system visibility be set to the specified value.
/// The actual visibility can be overridden by the system (i.e., proximity trigger) or by the user (boundary system disabled)
///
/// true to make the boundary visible.
public static void SetBoundaryVisible(bool boundaryVisible)
{
NativeMethods.SetBoundaryVisible(boundaryVisible);
}
}
}