QRayCasterHit Class▲
-
Header: QRayCasterHit
-
Since: Qt 5.11
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
-
qmake: QT += 3drender
Detailed Description▲
Qt3DRender::QRayCasterHit contains the details of a successful hit when casting a ray through a model using a Qt3DRender::QRayCaster or Qt3DRender::QScreenRayCaster component.
See Also▲
Member Type Documentation▲
enum QRayCasterHit::HitType▲
Specifies type of hit that was returned. This is controlled using QPickingSettings.
Constant |
Value |
Description |
---|---|---|
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 |
Member Function Documentation▲
float QRayCasterHit::distance() const▲
Returns the distance between the origin of the ray and the intersection point
Getter function for property distance.
Qt3DCore::QEntity *QRayCasterHit::entity() const▲
Returns a pointer to the entity that was hit
Getter function for property entity.
Qt3DCore::QNodeId QRayCasterHit::entityId() const▲
Returns the id of the entity that was hit
Getter function for property entityId.
QVector3D QRayCasterHit::localIntersection() const▲
Returns the coordinates of the intersection point in the entity's coordinate system
Getter function for property localIntersection.
uint QRayCasterHit::primitiveIndex() const▲
Returns the index of the picked primitive
Getter function for property primitiveIndex.
Qt3DRender::QRayCasterHit::HitType QRayCasterHit::type() const▲
Returns the type of the hit
Getter function for property type.
uint QRayCasterHit::vertex1Index() const▲
Returns the index of the first vertex of the picked primitive
Getter function for property vertex1Index.
uint QRayCasterHit::vertex2Index() const▲
Returns the index of the second vertex of the picked primitive
Getter function for property vertex2Index.
uint QRayCasterHit::vertex3Index() const▲
Returns the index of the third vertex of the picked primitive
Getter function for property vertex3Index.
QVector3D QRayCasterHit::worldIntersection() const▲
Returns the coordinates of the intersection point in the model's coordinate system
Getter function for property worldIntersection.