Skip to content

OpenXRSpatialContainerExtension

Inherits: OpenXRExtensionWrapper < Object

OpenXR extension that handles spatial containers.

OpenXR extension that handles spatial containers. Enabling this extension will automatically create a main spatial container, and update the lifecycle of the XR application.

Returns Method
Vector3 get_spatial_container_bounds()
OpenXRSpatialContainerState get_spatial_container_state()
Array get_supported_bounds_modes()
bool is_enabled() const
bool is_spatial_container_active() const
bool request_spatial_container_bounds_mode(bounds_mode: OpenXRSpatialContainerState.BoundsMode)
bool request_spatial_container_visible(visible: bool)

spatial_container_bounds_changed

spatial_container_bounds_changed(spatial_container_rid: RID, spatial_container_infinite_bounds: bool, spatial_container_bounds_mode: int, spatial_container_bounds: Vector3)

Emitted when the bounds of the spatial container specified by spatial_container_rid are updated.

spatial_container_bounds_mode_request_denied

spatial_container_bounds_mode_request_denied(spatial_container_rid: RID)

Emitted when a request to update the bounds mode of the spatial container specified by spatial_container_rid is denied by the runtime.

spatial_container_closed

spatial_container_closed(spatial_container_rid: RID)

Emitted when the spatial container specified by spatial_container_rid is closed.

spatial_container_interactable_changed

spatial_container_interactable_changed(spatial_container_rid: RID, spatial_container_interactable: bool)

Emitted when the interactability of the spatial container specified by spatial_container_rid is updated.

spatial_container_visible_changed

spatial_container_visible_changed(spatial_container_rid: RID, spatial_container_visible: bool)

Emitted when the visibility of the spatial container specified by spatial_container_rid is updated.

spatial_container_visible_request_denied

spatial_container_visible_request_denied(spatial_container_rid: RID)

Emitted when the runtime denies the visibility request of the spatial container specified by spatial_container_rid.

get_spatial_container_bounds

Vector3 get_spatial_container_bounds()

Retrieves the bounds of the main spatial container.

get_spatial_container_state

OpenXRSpatialContainerState get_spatial_container_state()

Retrieves the OpenXRSpatialContainerState of the main spatial container.

get_supported_bounds_modes

Array get_supported_bounds_modes()

Returns an array of supported spatial container bounds mode, see OpenXRSpatialContainerState.BoundsMode.

is_enabled

bool is_enabled() const

Returns true if spatial containers are enabled in the project settings and available on the current runtime.

is_spatial_container_active

bool is_spatial_container_active() const

Returns true if the main spatial container is active.

request_spatial_container_bounds_mode

bool request_spatial_container_bounds_mode(bounds_mode: OpenXRSpatialContainerState.BoundsMode)

Sends a request to the runtime to update the bounds mode of the main spatial container.

If the request is accepted, spatial_container_bounds_changed will be emitted with the updated bounds mode.

Otherwise, spatial_container_bounds_mode_request_denied will be emitted.

request_spatial_container_visible

bool request_spatial_container_visible(visible: bool)

Sends a request to the runtime to update the visibility of the spatial container.

If the request is accepted, spatial_container_visible_changed will be emitted with the updated visibility.

Otherwise, spatial_container_visible_request_denied will be emitted.