Skip to content

OpenXRSpatialMarkerTrackingCapability

Inherits: OpenXRExtensionWrapper < Object

Implementation for handling spatial entity marker tracking logic.

This class handles the OpenXR marker tracking spatial entity extension.

Returns Method
void do_entity_update(spatial_context: RID, component_data: Array[OpenXRSpatialComponentData], next_snapshot_create: OpenXRStructureBase = null, next_snapshot_query: OpenXRStructureBase = null)
OpenXRSpatialEntityExtension.TrackingState get_built_in_tracking_state()
bool is_april_tag_supported()
bool is_aruco_supported()
bool is_micro_qrcode_supported()
bool is_qrcode_supported()
bool start_built_in_tracking(marker_types: BitField[MarkerTypeFlags])
OpenXRFutureResult start_entity_discovery(spatial_context: RID, component_data: Array[OpenXRSpatialComponentData], next_snapshot_create: OpenXRStructureBase = null, next_snapshot_query: OpenXRStructureBase = null, user_callback: Callable = Callable())
void stop_built_in_tracking(clear_trackers: bool = true)

MarkerTypeFlags

enum MarkerTypeFlags (flags)

MARKER_QR_CODE = 1

QR Code.

MARKER_MICRO_QR_CODE = 2

Micro QR Code.

MARKER_ARUCO = 4

ArUco marker.

MARKER_APRIL_TAG = 8

April tag.

do_entity_update

void do_entity_update(spatial_context: RID, component_data: Array[OpenXRSpatialComponentData], next_snapshot_create: OpenXRStructureBase = null, next_snapshot_query: OpenXRStructureBase = null)

Calls OpenXRSpatialEntityExtension.update_spatial_entities() and OpenXRSpatialEntityExtension.query_snapshot() with the marker entities associated with spatial_context.

component_data are the OpenXRSpatialComponentDatas to update for this marker capability.

If next_snapshot_create is non-null, then pass this to the next parameter in OpenXRSpatialEntityExtension.update_spatial_entities().

If next_snapshot_query is non-null, then pass this to the next parameter in OpenXRSpatialEntityExtension.query_snapshot().

get_built_in_tracking_state

OpenXRSpatialEntityExtension.TrackingState get_built_in_tracking_state()

Returns the state of the built-in tracking system.

is_april_tag_supported

bool is_april_tag_supported()

Returns true if April tag marker tracking is supported by the current device.

is_aruco_supported

bool is_aruco_supported()

Returns true if ArUco marker tracking is supported by the current device.

is_micro_qrcode_supported

bool is_micro_qrcode_supported()

Returns true if micro QR code marker tracking is supported by the current device.

is_qrcode_supported

bool is_qrcode_supported()

Returns true if QR code marker tracking is supported by the current device.

start_built_in_tracking

bool start_built_in_tracking(marker_types: BitField[MarkerTypeFlags])

Starts the built-in marker tracking logic for the specified marker types. This will fail if built-in tracking is already enabled.

start_entity_discovery

OpenXRFutureResult start_entity_discovery(spatial_context: RID, component_data: Array[OpenXRSpatialComponentData], next_snapshot_create: OpenXRStructureBase = null, next_snapshot_query: OpenXRStructureBase = null, user_callback: Callable = Callable())

Calls OpenXRSpatialEntityExtension.discover_spatial_entities() and OpenXRSpatialEntityExtension.query_snapshot() with the marker entities associated with spatial_context.

component_data are the OpenXRSpatialComponentDatas to discover for this marker capability.

If next_snapshot_create is non-null, then pass this to the next parameter in OpenXRSpatialEntityExtension.discover_spatial_entities().

If next_snapshot_query is non-null, then pass this to the next parameter in OpenXRSpatialEntityExtension.query_snapshot().

user_callback, when non-null, is called with two parameters usually twice. The first parameter is the RID of the discovery snapshot and the second parameter is a boolean where false indicates the discovery snapshot is about to be processed, and true indicates the discovery snapshot has been processed and component_data has valid data. The second call is skipped if an error was encountered.

The returned OpenXRFutureResult is identical to the return from OpenXRSpatialEntityExtension.discover_spatial_entities().

stop_built_in_tracking

void stop_built_in_tracking(clear_trackers: bool = true)

Stops the built-in marker tracking logic.