Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

OpenXRSpatialMarkerTrackingCapability

实验性: This class may be changed or removed in future versions.

继承: OpenXRExtensionWrapper < Object

用于处理空间实体标记跟踪逻辑的实现。

描述

该类用于处理 OpenXR 标记跟踪空间实体扩展。

方法

void

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

bool

is_april_tag_supported()

bool

is_aruco_supported()

bool

is_micro_qrcode_supported()

bool

is_qrcode_supported()

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 do_entity_update(spatial_context: RID, component_data: Array[OpenXRSpatialComponentData], next_snapshot_create: OpenXRStructureBase = null, next_snapshot_query: OpenXRStructureBase = null) 🔗

使用与 spatial_context 关联的标记实体,调用 OpenXRSpatialEntityExtension.update_spatial_entities()OpenXRSpatialEntityExtension.query_snapshot() 方法。

component_data 是针对此标记功能需要更新的 OpenXRSpatialComponentData 数据。

如果 next_snapshot_create 不为空,则将其作为 next 参数传递给 OpenXRSpatialEntityExtension.update_spatial_entities() 方法;

如果 next_snapshot_query 不为空,则将其作为 next 参数传递给 OpenXRSpatialEntityExtension.query_snapshot() 方法。


bool is_april_tag_supported() 🔗

如果当前设备支持 April 标签标记跟踪,则返回 true


bool is_aruco_supported() 🔗

如果当前设备支持 Aruco 标记跟踪,则返回 true


bool is_micro_qrcode_supported() 🔗

如果当前设备支持微型二维码标记跟踪,则返回 true


bool is_qrcode_supported() 🔗

如果当前设备支持二维码标记跟踪,则返回 true


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()) 🔗

使用与 spatial_context 关联的标记实体,调用 OpenXRSpatialEntityExtension.discover_spatial_entities()OpenXRSpatialEntityExtension.query_snapshot() 方法。

component_data 是针对此标记功能需要发现的 OpenXRSpatialComponentData 数据。

如果 next_snapshot_create 不为空,则将其作为 next 参数传递给 OpenXRSpatialEntityExtension.discover_spatial_entities() 方法;

如果 next_snapshot_query 不为空,则将其作为 next 参数传递给 OpenXRSpatialEntityExtension.query_snapshot() 方法。

user_callback 在非空时,通常会被调用两次,并传入两个参数。第一个参数是发现快照(discovery snapshot)的 RID,第二个参数是一个布尔值:false 表示发现快照即将被处理,true 表示发现快照已处理完毕且 component_data 包含有效数据。如果遇到错误,则会跳过第二次调用。

返回的 OpenXRFutureResultOpenXRSpatialEntityExtension.discover_spatial_entities() 的返回值相同。