- class QRayCaster¶
QRayCaster
is used to perform ray casting tests in 3d world coordinates. More…Synopsis¶
Properties¶
Methods¶
def
__init__()
def
direction()
def
length()
def
origin()
Slots¶
def
pick()
def
setDirection()
def
setLength()
def
setOrigin()
def
trigger()
Signals¶
def
lengthChanged()
def
originChanged()
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
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.Holds the direction of the 3D ray. This should be a unit vector.
- Access functions:
- property lengthᅟ: float¶
Holds the length of the 3D ray.
- Access functions:
Signal
lengthChanged()
Holds the origin of the 3D ray in local coordinates.
- Access functions:
Signal
originChanged()
- __init__([parent=None])¶
- Parameters:
parent –
QNode
Getter of property
directionᅟ
.Notification signal of property
directionᅟ
.- length()¶
- Return type:
float
See also
setLength()
Getter of property
lengthᅟ
.- lengthChanged(length)¶
- Parameters:
length – float
Notification signal of property
lengthᅟ
.Getter of property
originᅟ
.Notification signal of property
originᅟ
.- pick(origin, direction, length)¶
- Parameters:
- Return type:
.list of Qt3DRender.QRayCasterHit
Setter of property
directionᅟ
.- 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
length()
Setter of property
lengthᅟ
.Setter of property
originᅟ
.- trigger()¶
Convenience method to enable the component and trigger tests using the current ray.
- trigger(origin, direction, length)
Convenience method to set the ray details
origin
,direction
, andlength
, and enable the component to trigger tests.