QRayCaster#
QRayCaster
is used to perform ray casting tests in 3d world coordinates. More…
Synopsis#
Properties#
Functions#
Slots#
Signals#
def
directionChanged
(direction)def
lengthChanged
(length)def
originChanged
(origin)
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#
The 3d ray is defined by its origin, direction and length. It will be affected by the transformations applied to the entity it belongs to.
Ray casting tests will be performed every frame as long as the component is enabled. The hits property will be updated with the list of intersections.
See also
QAbstractRayCaster
QScreenRayCaster
QNoPicking
- class PySide6.Qt3DRender.Qt3DRender.QRayCaster([parent=None])#
- Parameters:
parent –
PySide6.Qt3DCore.Qt3DCore.QNode
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCaster.direction: PySide6.QtGui.QVector3D#
Holds the direction of the 3D ray. This should be a unit vector.
- Access functions:
direction
()setDirection
(direction)Signal
directionChanged
(direction)
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCaster.length: float#
Holds the length of the 3D ray.
- Access functions:
length
()setLength
(length)Signal
lengthChanged
(length)
- property PᅟySide6.Qt3DRender.Qt3DRender.QRayCaster.origin: PySide6.QtGui.QVector3D#
Holds the origin of the 3D ray in local coordinates.
- Access functions:
origin
()setOrigin
(origin)Signal
originChanged
(origin)
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.direction()#
- Return type:
See also
Getter of property direction
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.directionChanged(direction)#
- Parameters:
direction –
PySide6.QtGui.QVector3D
Notification signal of property direction
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.length()#
- Return type:
float
See also
Getter of property length
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.lengthChanged(length)#
- Parameters:
length – float
Notification signal of property length
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.origin()#
- Return type:
See also
Getter of property origin
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.originChanged(origin)#
- Parameters:
origin –
PySide6.QtGui.QVector3D
Notification signal of property origin
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.pick(origin, direction, length)#
- Parameters:
origin –
PySide6.QtGui.QVector3D
direction –
PySide6.QtGui.QVector3D
length – float
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.setDirection(direction)#
- Parameters:
direction –
PySide6.QtGui.QVector3D
See also
Setter of property direction
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.setLength(length)#
- Parameters:
length – float
Sets the length of the ray to length
.
If the value is less than or equal to zero, the ray is concidered to be infinite.
See also
Setter of property length
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.setOrigin(origin)#
- Parameters:
origin –
PySide6.QtGui.QVector3D
See also
Setter of property origin
.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.trigger()#
Convenience method to enable the component and trigger tests using the current ray.
- PySide6.Qt3DRender.Qt3DRender.QRayCaster.trigger(origin, direction, length)
- Parameters:
origin –
PySide6.QtGui.QVector3D
direction –
PySide6.QtGui.QVector3D
length – float
Convenience method to set the ray details origin
, direction
, and length
, and enable the component to trigger tests.