QRayCaster Class
(Qt3DRender::QRayCaster)Qt3DRender::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.
Properties
- 3 properties inherited from Qt3DRender::QAbstractRayCaster
- 1 property inherited from Qt3DCore::QComponent
- 3 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject
Public Functions
- 6 public functions inherited from Qt3DRender::QAbstractRayCaster
- 2 public functions inherited from Qt3DCore::QComponent
- 13 public functions inherited from Qt3DCore::QNode
- 30 public functions inherited from QObject
Public Slots
void | setDirection(const QVector3D &direction) |
void | setLength(float length) |
void | setOrigin(const QVector3D &origin) |
void | trigger(const QVector3D &origin, const QVector3D &direction, float length) |
void | trigger() |
- 2 public slots inherited from Qt3DRender::QAbstractRayCaster
- 1 public slot inherited from Qt3DCore::QComponent
- 3 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject
Signals
void | directionChanged(const QVector3D &direction) |
void | lengthChanged(float length) |
void | originChanged(const QVector3D &origin) |
- 3 signals inherited from Qt3DRender::QAbstractRayCaster
- 3 signals inherited from Qt3DCore::QComponent
- 4 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject
Related Non-Members
typedef | QNodePtr |
typedef | QNodeVector |
typedef | QObjectList |
QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
Qt3DCore::QNodeId | qIdForNode(Qt3DCore::QNode *node) |
Qt3DCore::QNodeIdVector | qIdsForNodes(const T &nodes) |
T | qobject_cast(QObject *object) |
T | qobject_cast(const QObject *object) |
Macros
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Q_CLASSINFO(Name, Value) | |
Q_DISABLE_COPY(Class) | |
Q_DISABLE_COPY_MOVE(Class) | |
Q_DISABLE_MOVE(Class) | |
Q_EMIT | |
Q_ENUM(...) | |
Q_ENUM_NS(...) | |
Q_FLAG(...) | |
Q_FLAG_NS(...) | |
Q_GADGET | |
Q_INTERFACES(...) | |
Q_INVOKABLE | |
Q_NAMESPACE | |
Q_OBJECT | |
Q_PROPERTY(...) | |
Q_REVISION | |
Q_SET_OBJECT_NAME(Object) | |
Q_SIGNAL | |
Q_SIGNALS | |
Q_SLOT | |
Q_SLOTS |
Additional Inherited Members
- 9 static public members inherited from QObject
- 2 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject
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 and QScreenRayCaster.
Property Documentation
direction : QVector3D
Holds the direction of the 3D ray. This should be a unit vector.
Access functions:
QVector3D | direction() const |
void | setDirection(const QVector3D &direction) |
Notifier signal:
void | directionChanged(const QVector3D &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:
QVector3D | origin() const |
void | setOrigin(const QVector3D &origin) |
Notifier signal:
void | originChanged(const QVector3D &origin) |
Member Function Documentation
[slot]
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.
Note: Setter function for property length.
See also length().
[slot]
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.
[slot]
void QRayCaster::trigger()
Convenience method to enable the component and trigger tests using the current ray.