QRayCasterHit¶
- PyQt5.Qt3DRender.QRayCasterHit
Description¶
Details of a hit when casting a ray through a model.
QRayCasterHit contains the details of a successful hit when casting a ray through a model using a QRayCaster or QScreenRayCaster component.
See also
Enums¶
- HitType
Specifies type of hit that was returned. This is controlled using QPickingSettings.
Member
Value
Description
EntityHit 3
Only the bounding volume was considered; the primitive and vertex indices will be undefined
LineHit 1
The picked primitive was a line segment, and the first two vertices refer to the two points making up the line
PointHit 2
The picked primitive was a single point; all 3 vertex indices will be undefined
TriangleHit 0
The picked primitive was a triangle and the vertex indices refer to the three points making up the triangle
Methods¶
- __init__()
TODO
- __init__(QRayCasterHit)
TODO
- distance() → float
Returns the distance between the origin of the ray and the intersection point
- entity() → QEntity
Returns a pointer to the entity that was hit
- entityId() → QNodeId
Returns the id of the entity that was hit
- localIntersection() → QVector3D
Returns the coordinates of the intersection point in the entity’s coordinate system
- primitiveIndex() → int
Returns the index of the picked primitive
- type() → HitType
Returns the type of the hit
- vertex1Index() → int
Returns the index of the first vertex of the picked primitive
- vertex2Index() → int
Returns the index of the second vertex of the picked primitive
- vertex3Index() → int
Returns the index of the third vertex of the picked primitive
- worldIntersection() → QVector3D
Returns the coordinates of the intersection point in the model’s coordinate system