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.

OpenXRSpatialPlaneTrackingCapability

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

继承: OpenXRExtensionWrapper < Object

用于处理空间实体平面跟踪逻辑的实现。

描述

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

方法

bool

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


方法说明

bool is_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() 的返回值相同。