PySide6.Qt3DRender.Qt3DRender.QRayCasterHit¶
- class QRayCasterHit¶
Details of a hit when casting a ray through a model.
Details
QRayCasterHitcontains the details of a successful hit when casting a ray through a model using aQRayCasterorQScreenRayCastercomponent.See also
QRayCasterQScreenRayCasterQPickingSettingsSynopsis¶
Properties¶
distanceᅟ- The distance between the origin of the ray and the intersection pointentityᅟ- Pointer to the entity that was hitentityIdᅟ- The id of the entity that was hitlocalIntersectionᅟ- The coordinates of the intersection point in the entity’s coordinate systemprimitiveIndexᅟ- The index of the picked primitivetypeᅟ- The type of the hitvertex1Indexᅟ- The index of the first vertex of the picked primitivevertex2Indexᅟ- The index of the second vertex of the picked primitivevertex3Indexᅟ- The index of the third vertex of the picked primitiveworldIntersectionᅟ- The coordinates of the intersection point in the model’s coordinate system
Methods¶
def
__init__()def
distance()def
entity()def
entityId()def
primitiveIndex()def
toString()def
type()def
vertex1Index()def
vertex2Index()def
vertex3Index()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- class HitType¶
Specifies type of hit that was returned. This is controlled using
QPickingSettings.Constant
Description
Qt3DRender.QRayCasterHit.TriangleHit
The picked primitive was a triangle and the vertex indices refer to the three points making up the triangle
Qt3DRender.QRayCasterHit.LineHit
The picked primitive was a line segment, and the first two vertices refer to the two points making up the line
Qt3DRender.QRayCasterHit.PointHit
The picked primitive was a single point; all 3 vertex indices will be undefined
Qt3DRender.QRayCasterHit.EntityHit
Only the bounding volume was considered; the primitive and vertex indices will be undefined
Note
Properties can be used directly when
from __feature__ import true_propertyis used or via accessor functions otherwise.- property distanceᅟ: float¶
This property holds the distance between the origin of the ray and the intersection point..
Holds the distance from the ray origin to the point where the ray intersected with the entity.
- Access functions:
This property holds a pointer to the entity that was hit..
Holds a pointer to the QEntity that was hit by the ray.
- Access functions:
This property holds the id of the entity that was hit..
Holds the node id of the entity that was hit by the ray.
- Access functions:
This property holds the coordinates of the intersection point in the entity’s coordinate system..
Holds the coordinates of the intersection point in the entity’s local coordinate system.
- Access functions:
- property primitiveIndexᅟ: int¶
This property holds the index of the picked primitive..
Holds the index of the primitive (triangle, line, or point) that was picked.
- Access functions:
- property typeᅟ: Qt3DRender.QRayCasterHit.HitType¶
This property holds the type of the hit..
Holds the type of the hit, which can be
TriangleHit,LineHit,PointHit, orEntityHit.- Access functions:
- property vertex1Indexᅟ: int¶
This property holds the index of the first vertex of the picked primitive..
Holds the index of the first vertex of the picked primitive. For a triangle hit, this is one of the three vertices. For a line hit, this is one of the two vertices.
- Access functions:
- property vertex2Indexᅟ: int¶
This property holds the index of the second vertex of the picked primitive..
Holds the index of the second vertex of the picked primitive. For a triangle hit, this is one of the three vertices. For a line hit, this is one of the two vertices.
- Access functions:
- property vertex3Indexᅟ: int¶
This property holds the index of the third vertex of the picked primitive..
Holds the index of the third vertex of the picked primitive. This is only valid for triangle hits.
- Access functions:
This property holds the coordinates of the intersection point in the model’s coordinate system..
Holds the coordinates of the intersection point in the world coordinate system.
- Access functions:
- __init__()¶
- __init__(other)
- Parameters:
other –
QRayCasterHit
- __init__(type, id, distance, localIntersect, worldIntersect, primitiveIndex, v1, v2, v3)
- distance()¶
- Return type:
float
Returns the distance between the origin of the ray and the intersection point
Getter of property
distanceᅟ.- entity()¶
- Return type:
QEntity
Returns a pointer to the entity that was hit
Getter of property
entityᅟ.- entityId()¶
- Return type:
QNodeId
Returns the id of the entity that was hit
Getter of property
entityIdᅟ.Returns the coordinates of the intersection point in the entity’s coordinate system
Getter of property
localIntersectionᅟ.- primitiveIndex()¶
- Return type:
int
Returns the index of the picked primitive
Getter of property
primitiveIndexᅟ.- toString()¶
- Return type:
str
- type()¶
- Return type:
HitType
Returns the type of the hit
Getter of property
typeᅟ.- vertex1Index()¶
- Return type:
int
Returns the index of the first vertex of the picked primitive
Getter of property
vertex1Indexᅟ.- vertex2Index()¶
- Return type:
int
Returns the index of the second vertex of the picked primitive
Getter of property
vertex2Indexᅟ.- vertex3Index()¶
- Return type:
int
Returns the index of the third vertex of the picked primitive
Getter of property
vertex3Indexᅟ.Returns the coordinates of the intersection point in the model’s coordinate system
Getter of property
worldIntersectionᅟ.