pickResult QML Value Type

包含挑选结果。更多

Import Statement: import QtQuick3D

属性

详细说明

作为View3D::pick 的返回对象创建。

属性文档

distance : real [read-only]

该属性保存拾取原点与命中位置之间的距离,即射线的长度。在使用视口坐标进行拾取的情况下,拾取原点将是活动摄像机的位置。


hitType : enumeration [read-only, since 6.8]

该属性用于保存拾取结果的命中类型。

常数说明
PickResult.Null拾取没有命中任何物体。
PickResult.Model拾取结果击中了一个模型。
PickResult.Item选取结果命中了QQuickItem

此属性在 Qt 6.8 中引入。


instanceIndex : int [read-only, since 6.5]

该属性保存拾取击中实例模型的实例表中的索引。

此属性在 Qt 6.5 中引入。


itemHit : Item [read-only, since 6.8]

该属性保存拾取击中的Qt Quick 项目。如果hitType 不是pickResult.Item ,该值将为空。

此属性在 Qt 6.8 中引入。

另请参阅 objectHit


normal : vector3d [read-only]

该属性保存在局部坐标空间中被击中的面的法线。

注意: 对于 2D 项目,该值始终为 (0,0,1)。


objectHit : Model [read-only]

此属性保存被拾取击中的模型对象。如果hitType 不是pickResult.Model ,该值将为空。

另请参见 itemHit


position : vector3d [read-only]

此属性保存被拾取对象在局部坐标空间中的场景位置。


sceneNormal : vector3d [read-only]

该属性保存被击中的面在场景坐标空间中的法线。


scenePosition : vector3d [read-only]

此属性保存被击中的场景位置。


uvPosition : vector2d [read-only]

该属性显示被击中的 UV 位置。UV 位置是根据被击中点相对于边界体积的归一化局部 x 坐标和 y 坐标计算得出的。该属性有助于进一步拾取屏幕外渲染的对象。

hitTypepickResult.Item 时,该值将表示命中点在itemHit 坐标空间中的位置。


© 2025 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.