Class BoundaryVisibilityFeature
Use this OpenXR feature to control boundary visibility on Meta Quest devices.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.OpenXR.Features.Meta
Assembly: Unity.XR.MetaOpenXR.dll
Syntax
public class BoundaryVisibilityFeature : MetaOpenXRFeature
Fields
XR_BOUNDARY_VISIBILITY_SUPPRESSION_NOT_ALLOWED_META
Integer value of UnityEngine.XR.OpenXR.NativeTypes.XrResult which indicates that the runtime did not accept the request to suppress the boundary visibility. This is expected when the app is not rendering passthrough.
Declaration
public const int XR_BOUNDARY_VISIBILITY_SUPPRESSION_NOT_ALLOWED_META = 1000528000
Field Value
Type | Description |
---|---|
int | Equal to |
Remarks
Cast your UnityEngine.XR.OpenXR.NativeTypes.XrResult to int
and compare with this value to determine if the runtime
did not accept your request to suppress the boundary visibility.
featureId
The feature id string. This is used to give the feature a well known id for reference.
Declaration
public const string featureId = "com.unity.openxr.feature.meta-boundary-visibility"
Field Value
Type | Description |
---|---|
string | The feature id. |
Properties
currentVisibility
Get the current boundary visibility.
Declaration
public XrBoundaryVisibility currentVisibility { get; }
Property Value
Type | Description |
---|---|
XrBoundaryVisibility | The current visibility. |
Methods
GetValidationChecks(List<ValidationRule>, BuildTargetGroup)
Validation Rules for Boundary Visibility feature.
Declaration
protected override void GetValidationChecks(List<OpenXRFeature.ValidationRule> rules, BuildTargetGroup targetGroup)
Parameters
Type | Name | Description |
---|---|---|
List<OpenXRFeature.ValidationRule> | rules | |
BuildTargetGroup | targetGroup |
Overrides
OnInstanceCreate(ulong)
Called after xrCreateInstance
. Override this method to validate that any necessary OpenXR extensions were
successfully enabled
(OpenXRRuntime.IsExtensionEnabled)
and that any required system properties are supported. If this method returns false,
the feature's enabled property is set to false.
Declaration
protected override bool OnInstanceCreate(ulong xrInstance)
Parameters
Type | Name | Description |
---|---|---|
ulong | xrInstance | Handle of the native |
Returns
Type | Description |
---|---|
bool | true if this feature successfully initialized. Otherwise, false. |
Overrides
Remarks
If this feature is a required feature of an enabled feature set, returning false here
causes the OpenXRLoader
to fail, and XR Plug-in Management will fall back to another loader if enabled.
See Also
TryRequestBoundaryVisibility(XrBoundaryVisibility)
Attempts to request a change to the current boundary visibility. If the request returns
XR_SUCCESS
, Meta's OpenXR runtime is expected to subsequently change the boundary
visibility and invoke the boundaryVisibilityChanged event.
Declaration
public XrResult TryRequestBoundaryVisibility(XrBoundaryVisibility visibility)
Parameters
Type | Name | Description |
---|---|---|
XrBoundaryVisibility | visibility | The desired boundary visibility. |
Returns
Type | Description |
---|---|
XrResult | The result that indicates whether the operation succeeded. |
Remarks
This method can return multiple possible success codes, most notably:
XR_SUCCESS
if the request was successfully made.XR_BOUNDARY_VISIBILITY_SUPPRESSION_NOT_ALLOWED_META
if the runtime did not accept the request to suppress the boundary visibility.
Events
boundaryVisibilityChanged
Invoked whenever the Meta OpenXR runtime's boundary visibility has changed. Visibility may change in response to TryRequestBoundaryVisibility(XrBoundaryVisibility) or at the discretion of Meta's OpenXR runtime, such as if your app fully obscures the physical environment.
Declaration
public event EventHandler<XrBoundaryVisibility> boundaryVisibilityChanged
Event Type
Type | Description |
---|---|
EventHandler<XrBoundaryVisibility> | The new boundary visibility. |