pickResult QML Value Type
包含挑选结果。更多
| Import Statement: | import QtQuick3D |
属性
- distance : real
- hitType : enumeration
(since 6.8) - instanceIndex : int
(since 6.5) - itemHit : Item
(since 6.8) - normal : vector3d
- objectHit : Model
- position : vector3d
- sceneNormal : vector3d
- scenePosition : vector3d
- uvPosition : vector2d
详细说明
作为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 坐标。该属性有助于进一步拾取屏幕外渲染的对象。
© 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.