本页内容

XrSpatialAnchorListModel QML Type

提供了一个包含空间锚点的模型。更多内容...

Import Statement: import QtQuick3D.Xr
Since: Qt 6.8
Inherits:

ListModel

Status: Technology preview

此类型处于技术预览阶段,可能会有变动。

属性

方法

详细说明

该类型提供了一组空间锚点,这些锚点是物理世界中的点,可以被追踪并与虚拟内容相关联。

该列表包含具有anchor 属性的元素,其类型为XrSpatialAnchor 。

您可以按以下方式使用它:

Repeater3D {
    model: XrSpatialAnchorListModel {
    }
    delegate: Node {
        required property XrSpatialAnchor anchor
        position: anchor.position
        rotation: anchor.rotation
        // Further use of anchor properties...
    }
}

属性文档

classificationFilter : enumeration

存储用于过滤空间锚点的分类标志。

ClassificationFlag 过滤器由一组标志组合表示:

常量值
XrSpatialAnchorListModel.Wall
XrSpatialAnchorListModel.Ceiling
XrSpatialAnchorListModel.Floor
XrSpatialAnchorListModel.Table
XrSpatialAnchorListModel.Seat
XrSpatialAnchorListModel.Window
XrSpatialAnchorListModel.Door
XrSpatialAnchorListModel.Other

classificationStringFilter : list<string>

存储用于过滤空间锚点的分类字符串。

如果filterMode 设置为Classification ,则可使用此属性提供一组用于过滤的额外分类字符串。这些标签将与空间锚点XrSpatialAnchor::classificationString 属性报告的相同值进行匹配。

注意:只有 被归类为“Other ”的spatial anchors 才会被纳入此过滤器进行检查。

filterMode : enumeration

指定空间锚点的过滤模式。

存储过滤模式。过滤模式可以是以下之一:

常量描述
XrSpatialAnchorListModel.All显示所有空间锚点。
XrSpatialAnchorListModel.Classification根据提供的分类过滤标志显示空间锚点。
XrSpatialAnchorListModel.Identifier根据与提供的标识符的匹配情况显示空间锚点。

identifierFilter : list<string>

包含用于过滤空间锚点的标识符列表。

方法文档

void requestSceneCapture()

此方法会触发一次扫描,以采集或更新当前环境的空间数据。

此方法会触发底层 XR 系统对用户当前物理环境进行场景捕获,以更新或优化空间网格,从而实现空间锚点的更精准放置和追踪。

注意:某些 平台不会自动执行此操作。例如,在 Quest 3 上,如果用户位于此前未被捕获的空间中,该方法不会自动调用,导致在手动触发捕获之前没有可用的锚点。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.