QRayCaster Class
class Qt3DRender::QRayCasterQt3DRender::QRayCaster is used to perform ray casting tests in 3d world coordinates. More...
Header: | #include <QRayCaster> |
qmake: | QT += 3drender |
Since: | Qt 5.11 |
Instantiated By: | RayCaster |
Inherits: | Qt3DRender::QAbstractRayCaster |
This class was introduced in Qt 5.11.
Public Functions
void | setLength(float length) |
void | trigger() |
void | trigger(const QVector3D &origin, const QVector3D &direction, float length) |
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, and QNoPicking.
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.
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.