QRayCaster Class▲
-
Header: QRayCaster
-
Since: Qt 5.11
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
-
qmake: QT += 3drender
-
Inherited By:
-
Instantiated By: qml-qt3d-render-raycaster.xml
-
Inherits: Qt3DRender::QAbstractRayCaster
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▲
See also QAbstractRayCaster, QScreenRayCaster, QNoPicking
Property Documentation▲
direction : QVector3D▲
Holds the direction of the 3D ray. This should be a unit vector.
Access functions:
-
direction() const
-
void setDirection(const &direction)
Notifier signal:
-
void directionChanged(const &direction)
length : float▲
Holds the length of the 3D ray.
Access functions:
-
float length() const
-
void setLength(float length)
Notifier signal:
-
void lengthChanged(float length)
origin : QVector3D▲
Holds the origin of the 3D ray in local coordinates.
Access functions:
-
origin() const
-
void setOrigin(const &origin)
Notifier signal:
-
void originChanged(const &origin)
Member Function Documentation▲
void QRayCaster::setLength(float length)▲
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.
Setter function for property length.
See Also▲
See also length()
void QRayCaster::trigger()▲
Convenience method to enable the component and trigger tests using the current ray.
void QRayCaster::trigger(const QVector3D &origin, const QVector3D &direction, float length)▲
Convenience method to set the ray details origin, direction, and length, and enable the component to trigger tests.