QRayCaster

QRayCaster is used to perform ray casting tests in 3d world coordinates. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QRayCaster

New in version 5.11.

Synopsis

Functions

Slots

Signals

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

parentPySide6.Qt3DCore.Qt3DCore.QNode

PySide6.Qt3DRender.Qt3DRender.QRayCaster.direction()
Return type

PySide6.QtGui.QVector3D

Holds the direction of the 3D ray. This should be a unit vector.

PySide6.Qt3DRender.Qt3DRender.QRayCaster.directionChanged(direction)
Parameters

directionPySide6.QtGui.QVector3D

PySide6.Qt3DRender.Qt3DRender.QRayCaster.length()
Return type

float

Holds the length of the 3D ray.

PySide6.Qt3DRender.Qt3DRender.QRayCaster.lengthChanged(length)
Parameters

length – float

PySide6.Qt3DRender.Qt3DRender.QRayCaster.origin()
Return type

PySide6.QtGui.QVector3D

Holds the origin of the 3D ray in local coordinates.

PySide6.Qt3DRender.Qt3DRender.QRayCaster.originChanged(origin)
Parameters

originPySide6.QtGui.QVector3D

PySide6.Qt3DRender.Qt3DRender.QRayCaster.pick(origin, direction, length)
Parameters
Return type

PySide6.Qt3DRender.Qt3DRender.QRayCaster.setDirection(direction)
Parameters

directionPySide6.QtGui.QVector3D

Holds the direction of the 3D ray. This should be a unit vector.

PySide6.Qt3DRender.Qt3DRender.QRayCaster.setLength(length)
Parameters

length – float

Holds the length of the 3D ray.

PySide6.Qt3DRender.Qt3DRender.QRayCaster.setOrigin(origin)
Parameters

originPySide6.QtGui.QVector3D

Holds the origin of the 3D ray in local coordinates.

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

Convenience method to set the ray details origin, direction, and length, and enable the component to trigger tests.