QRayCasterHit#
Details of a hit when casting a ray through a model. More…
Synopsis#
Properties#
Functions#
def
distance
()def
entity
()def
entityId
()def
localIntersection
()def
primitiveIndex
()def
toString
()def
type
()def
vertex1Index
()def
vertex2Index
()def
vertex3Index
()def
worldIntersection
()
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
Detailed Description#
QRayCasterHit
contains the details of a successful hit when casting a ray through a model using a QRayCaster
or QScreenRayCaster
component.
See also
QRayCaster
QScreenRayCaster
QPickingSettings
- class PySide6.Qt3DRender.Qt3DRender.QRayCasterHit#
PySide6.Qt3DRender.Qt3DRender.QRayCasterHit(type, id, distance, localIntersect, worldIntersect, primitiveIndex, v1, v2, v3)
PySide6.Qt3DRender.Qt3DRender.QRayCasterHit(other)
- Parameters:
primitiveIndex – int
v3 – int
distance – float
v2 – int
type –
HitType
localIntersect –
PySide6.QtGui.QVector3D
worldIntersect –
PySide6.QtGui.QVector3D
v1 – int
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.distance: float#
- Access functions:
distance
()
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.entity: PySide6.Qt3DCore.Qt3DCore.QEntity#
- Access functions:
entity
()
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.entityId: PySide6.Qt3DCore.Qt3DCore.QNodeId#
- Access functions:
entityId
()
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.localIntersection: PySide6.QtGui.QVector3D#
- Access functions:
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.primitiveIndex: int#
- Access functions:
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.type: HitType#
- Access functions:
type
()
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.vertex1Index: int#
- Access functions:
vertex1Index
()
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.vertex2Index: int#
- Access functions:
vertex2Index
()
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.vertex3Index: int#
- Access functions:
vertex3Index
()
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCasterHit.worldIntersection: PySide6.QtGui.QVector3D#
- Access functions:
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.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
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.distance()#
- Return type:
float
Returns the distance between the origin of the ray and the intersection point
Getter of property distance
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.entity()#
- Return type:
Returns a pointer to the entity that was hit
Getter of property entity
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.entityId()#
- Return type:
Returns the id of the entity that was hit
Getter of property entityId
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.localIntersection()#
- Return type:
Returns the coordinates of the intersection point in the entity’s coordinate system
Getter of property localIntersection
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.primitiveIndex()#
- Return type:
int
Returns the index of the picked primitive
Getter of property primitiveIndex
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.toString()#
- Return type:
str
Returns the type of the hit
Getter of property type
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.vertex1Index()#
- Return type:
int
Returns the index of the first vertex of the picked primitive
Getter of property vertex1Index
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.vertex2Index()#
- Return type:
int
Returns the index of the second vertex of the picked primitive
Getter of property vertex2Index
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.vertex3Index()#
- Return type:
int
Returns the index of the third vertex of the picked primitive
Getter of property vertex3Index
.
- PySide6.Qt3DRender.Qt3DRender.QRayCasterHit.worldIntersection()#
- Return type:
Returns the coordinates of the intersection point in the model’s coordinate system
Getter of property worldIntersection
.