|
QGIS API Documentation 3.99.0-Master (2fe06baccd8)
|
A representation of a ray in 3D. More...
#include <qgsray3d.h>
Public Member Functions | |
| QgsRay3D (const QVector3D &origin, const QVector3D &direction) | |
| Constructor. | |
| double | angleToPoint (const QVector3D &point) const |
| Returns the angle between the ray and the vector from the ray's origin and the point point. | |
| QVector3D | direction () const |
| Returns the direction of the ray see setDirection(). | |
| QVector3D | directionInversed () const |
| Returns a vector with the direction components inversed ( 1/x, 1/y, 1/z) This can be used as an optimization when used in intersection logic. | |
| bool | isInFront (const QVector3D &point) const |
| Checks whether the point is in front of the ray. | |
| QVector3D | origin () const |
| Returns the origin of the ray. | |
| QVector3D | point (float distance) const |
| Returns the point along the ray with the specified distance from the ray's origin. | |
| float | projectedDistance (const QVector3D &point) const |
| Returns the distance of the projection of a point to the ray. | |
| QVector3D | projectedPoint (const QVector3D &point) const |
| Returns the projection of the point on the ray (which is the closest point of the ray to point). | |
| void | setDirection (const QVector3D direction) |
| Sets the direction of the ray. | |
| void | setOrigin (const QVector3D &origin) |
| Sets the origin of the ray. | |
A representation of a ray in 3D.
A ray is composed of an origin point (the start of the ray) and a direction vector.
Definition at line 30 of file qgsray3d.h.
| QgsRay3D::QgsRay3D | ( | const QVector3D & | origin, |
| const QVector3D & | direction ) |
Constructor.
Definition at line 19 of file qgsray3d.cpp.
| double QgsRay3D::angleToPoint | ( | const QVector3D & | point | ) | const |
Returns the angle between the ray and the vector from the ray's origin and the point point.
Definition at line 57 of file qgsray3d.cpp.
|
inline |
Returns the direction of the ray see setDirection().
Definition at line 50 of file qgsray3d.h.
|
inline |
Returns a vector with the direction components inversed ( 1/x, 1/y, 1/z) This can be used as an optimization when used in intersection logic.
see direction()
Definition at line 57 of file qgsray3d.h.
| bool QgsRay3D::isInFront | ( | const QVector3D & | point | ) | const |
Checks whether the point is in front of the ray.
Definition at line 52 of file qgsray3d.cpp.
|
inline |
| QVector3D QgsRay3D::point | ( | float | distance | ) | const |
Returns the point along the ray with the specified distance from the ray's origin.
Definition at line 68 of file qgsray3d.cpp.
| float QgsRay3D::projectedDistance | ( | const QVector3D & | point | ) | const |
Returns the distance of the projection of a point to the ray.
Definition at line 47 of file qgsray3d.cpp.
| QVector3D QgsRay3D::projectedPoint | ( | const QVector3D & | point | ) | const |
Returns the projection of the point on the ray (which is the closest point of the ray to point).
Definition at line 42 of file qgsray3d.cpp.
| void QgsRay3D::setDirection | ( | const QVector3D | direction | ) |
Sets the direction of the ray.
Definition at line 34 of file qgsray3d.cpp.
| void QgsRay3D::setOrigin | ( | const QVector3D & | origin | ) |