OpenXRMetaEnvironmentDepthExtensionWrapper

Inherits: OpenXRExtensionWrapperExtension

Wraps the XR_META_environment_depth extension.

Description

Wraps the XR_META_environment_depth extension.

Methods

void

get_environment_depth_map_async ( Callable callback )

bool

get_hand_removal_enabled ( ) const

bool

is_environment_depth_started ( )

bool

is_environment_depth_supported ( )

bool

is_hand_removal_supported ( )

void

set_hand_removal_enabled ( bool enable )

void

start_environment_depth ( )

void

stop_environment_depth ( )


Signals

openxr_meta_environment_depth_started ( )

Emitted after environment depth successfully starts.


openxr_meta_environment_depth_stopped ( )

Emitted after environment depth successfully stops.


Method Descriptions

void get_environment_depth_map_async ( Callable callback )

Requests that the environment depth map data (including the image data) be sent to the given callback for use on the CPU.

This can be used for things like implementing your own realtime plane tracking.

The callback will be called with an array of two dictionaries (one for each eye), containing:

  • depth_projection_view: (Projection) The projection view matrix for the depth map.

  • depth_inverse_projection_view: (Projection) The inverse projection view matrix for the depth map.

  • image: (Image) The depth map image data.

This method should be called sparingly, and definitely not on every frame. First of all, the depth map image isn't updated every frame - it's closer to every 2-4 frames, depending on the display's refresh rate. But, also, the depth map is provided to us as GPU resource that we need to download to the CPU, which isn't the fastest operation. It would be reasonable to call this from a timer that goes off every 1 second, for example.

If you need to use the depth map for rendering, it's recommended that you do so from a shader (instead of using this method), which will be able to access the depth map texture on the GPU directly via global shader uniforms, as well as up-to-date projection information for use on the current frame.


bool get_hand_removal_enabled ( ) const

Returns true if hand removal is enabled; otherwise, false.


bool is_environment_depth_started ( )

Returns true if environment depth has been started; otherwise, false.


bool is_environment_depth_supported ( )

Returns true if environment depth is supported; otherwise, false.


bool is_hand_removal_supported ( )

Returns true if hand removal is supported; otherwise, false.


void set_hand_removal_enabled ( bool enable )

Enables or disables hand removal.

When enabled, the runtime will attempt to remove the user's hands from the environment depth data. However, this will only work if hand tracking is enabled and the user isn't using controllers.


void start_environment_depth ( )

Starts environment depth.


void stop_environment_depth ( )

Stops environment depth.