Qt3DRender::QRayCasterHit Class
class Qt3DRender::QRayCasterHit投射射线穿过模型时命中的详细信息。更多
头文件: | #include <QRayCasterHit> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
状态: | 已废弃 |
公共类型
enum | HitType { TriangleHit, LineHit, PointHit, EntityHit } |
公共函数
float | distance() const |
Qt3DCore::QEntity * | entity() const |
Qt3DCore::QNodeId | entityId() const |
QVector3D | localIntersection() const |
uint | primitiveIndex() const |
Qt3DRender::QRayCasterHit::HitType | type() const |
uint | vertex1Index() const |
uint | vertex2Index() const |
uint | vertex3Index() const |
QVector3D | worldIntersection() const |
详细描述
Qt3DRender::QRayCasterHit 包含使用 或 组件在模型中投射射线时成功命中的详细信息。Qt3DRender::QRayCaster Qt3DRender::QScreenRayCaster
另请参阅 Qt3DRender::QRayCaster,Qt3DRender::QScreenRayCaster, 和Qt3DRender::QPickingSettings 。
成员类型文档
enum QRayCasterHit::HitType
指定返回的命中类型。可通过QPickingSettings 控制。
常量 | 值 | 说明 |
---|---|---|
Qt3DRender::QRayCasterHit::TriangleHit | 0 | 选中的基元是一个三角形,顶点索引指的是构成三角形的三个点 |
Qt3DRender::QRayCasterHit::LineHit | 1 | 选中的基元是一条线段,前两个顶点指的是组成该线段的两个点 |
Qt3DRender::QRayCasterHit::PointHit | 2 | 选取的基元是一个点;所有 3 个顶点索引都未定义 |
Qt3DRender::QRayCasterHit::EntityHit | 3 | 只考虑了边界体积;基元和顶点索引将未定义 |
成员函数文档
float QRayCasterHit::distance() const
返回射线原点与交点之间的距离
注: 属性距离的获取函数。
Qt3DCore::QEntity *QRayCasterHit::entity() const
返回指向被击中实体的指针
注: 属性实体的获取函数。
Qt3DCore::QNodeId QRayCasterHit::entityId() const
返回被击中实体的 ID
注: 属性 entityId 的获取函数。
QVector3D QRayCasterHit::localIntersection() const
返回交叉点在实体坐标系中的坐标
注: 属性 localIntersection 的获取函数。
uint QRayCasterHit::primitiveIndex() const
返回选中基元的索引
注: 属性 primitiveIndex 的获取函数。
Qt3DRender::QRayCasterHit::HitType QRayCasterHit::type() const
返回命中的类型
注: 属性类型的获取函数。
uint QRayCasterHit::vertex1Index() const
返回选取基元的第一个顶点的索引
注: 属性 vertex1Index 的获取函数。
uint QRayCasterHit::vertex2Index() const
返回选取基元的第二个顶点的索引
注: 属性 vertex2Index 的获取函数。
uint QRayCasterHit::vertex3Index() const
返回选取基元的第三个顶点的索引
注: 属性 vertex3Index 的获取函数。
QVector3D QRayCasterHit::worldIntersection() const
返回模型坐标系中交点的坐标
注: 属性 worldIntersection 的获取函数。
© 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.