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
[OpenXRFeature(UiName = "Meta Quest: Boundary Visibility", BuildTargetGroups = new BuildTargetGroup[] { BuildTargetGroup.Android, BuildTargetGroup.Standalone }, Company = "Unity Technologies", Desc = "Enables you to suppress the visibility of the boundary so that users can move freely when passthrough is enabled", DocumentationLink = "https://docs.unity3d.com/Packages/com.unity.xr.meta-openxr@2.3/manual/features/boundary-visibility.html", OpenxrExtensionStrings = "XR_META_boundary_visibility", Category = "Feature", FeatureId = "com.unity.openxr.feature.meta-boundary-visibility", Version = "0.1.0")]
public class BoundaryVisibilityFeature : MetaOpenXRFeature
Fields
XR_BOUNDARY_VISIBILITY_SUPPRESSION_NOT_ALLOWED_META
Integer value of 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 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_SUCCESSif the request was successfully made.XR_BOUNDARY_VISIBILITY_SUPPRESSION_NOT_ALLOWED_METAif the runtime did not accept the request to suppress the boundary visibility.
Events
boundaryVisibilityChanged
Invoked whenever the OpenXR Meta 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. |