XRPassthroughFeature

This OpenXRInteractionFeature configures the XR_ANDROID_composition_layer_passthrough_mesh and XR_ANDROID_passthrough_camera_state extensions at OpenXR runtime and provides passthrough geometry capabilities in the OpenXR platform.

Use Unity.XR.CompositionLayers.CompositionLayer with Passthrough layer type to access passthrough cutout at runtime. Note: a valid MeshFilter.mesh is required to configure the layer geometry.

Summary

Inheritance

Inherits from: OpenXRFeature

Public attributes

ExtensionStrings = "XR_ANDROID_composition_layer_passthrough_mesh " + "XR_ANDROID_passthrough_camera_state"
const string
The OpenXR Extension strings.
FeatureId = "com.google.xr.extensions.passthrough_composition_layer"
const string
The feature ID string.
UiName = "Android XR (Extensions): Passthrough Composition Layer"
const string
The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes.

Public static attributes

IsExensionEnabled => _extensionEnabled
bool
Gets if the required OpenXR extension is enabled.

Public static functions

GetState()
Get the state of the passthrough camera.

Public attributes

ExtensionStrings

const string ExtensionStrings =
            "XR_ANDROID_composition_layer_passthrough_mesh " +
            "XR_ANDROID_passthrough_camera_state"

The OpenXR Extension strings.

Used to check if this extensions is available or enabled.

FeatureId

const string FeatureId = "com.google.xr.extensions.passthrough_composition_layer"

The feature ID string.

UiName

const string UiName = "Android XR (Extensions): Passthrough Composition Layer"

The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes.

Public static attributes

IsExensionEnabled

bool IsExensionEnabled => _extensionEnabled

Gets if the required OpenXR extension is enabled.

When OpenXR runtime is waiting, it returns null. Otherwise, it indicates whether the XR_ANDROID_composition_layer_passthrough_mesh extension is enabled.

Public static functions

GetState

XRPassthroughCameraStates GetState()

Get the state of the passthrough camera.

Details
Returns
The current state of the passthrough camera.

Kotlin 是 Android 推荐用于现代 Android 开发的编程语言。

Updated Sep 18, 2023

API reference packages and classes for Android app developers.

Updated Feb 10, 2025

Android Studio 提供了一些应用构建器以及一个已针对 Android 应用进行优化的集成式开发环境 (IDE)。立即下载 Android Studio。

Updated Aug 23, 2024