Details of a hit when casting a ray through a model. 更多...
头: | #include <QRayCasterHit> |
CMake: |
find_package(Qt6 COMPONENTS 3drender REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
Since: | Qt 5.11 |
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 contains the details of a successful hit when casting a ray through a model using a Qt3DRender::QRayCaster or Qt3DRender::QScreenRayCaster 组件。
另请参阅 Qt3DRender::QRayCaster , Qt3DRender::QScreenRayCaster ,和 Qt3DRender::QPickingSettings .
Specifies type of hit that was returned. This is controlled using QPickingSettings .
常量 | 值 | 描述 |
---|---|---|
Qt3DRender::QRayCasterHit::TriangleHit
|
0
|
The picked primitive was a triangle and the vertex indices refer to the three points making up the triangle |
Qt3DRender::QRayCasterHit::LineHit
|
1
|
The picked primitive was a line segment, and the first two vertices refer to the two points making up the line |
Qt3DRender::QRayCasterHit::PointHit
|
2
|
The picked primitive was a single point; all 3 vertex indices will be undefined |
Qt3DRender::QRayCasterHit::EntityHit
|
3
|
Only the bounding volume was considered; the primitive and vertex indices will be undefined |
Returns the distance between the origin of the ray and the intersection point
注意: Getter function for property distance.
Returns a pointer to the entity that was hit
注意: Getter function for property entity.
Returns the id of the entity that was hit
注意: Getter function for property entityId.
Returns the coordinates of the intersection point in the entity's coordinate system
注意: Getter function for property localIntersection.
Returns the index of the picked primitive
注意: Getter function for property primitiveIndex.
Returns the type of the hit
注意: getter 函数对于特性 type。
Returns the index of the first vertex of the picked primitive
注意: Getter function for property vertex1Index.
Returns the index of the second vertex of the picked primitive
注意: Getter function for property vertex2Index.
Returns the index of the third vertex of the picked primitive
注意: Getter function for property vertex3Index.
Returns the coordinates of the intersection point in the model's coordinate system
注意: Getter function for property worldIntersection.