QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
Public Member Functions | List of all members
QgsRay3D Class Reference

A representation of a ray in 3D. More...

#include <qgsray3d.h>

Public Member Functions

 QgsRay3D (const QVector3D &origin, const QVector3D &direction)
 Constructor. More...
 
double angleToPoint (const QVector3D &point) const
 Returns the angle between the ray and the vector from the ray's origin and the point point. More...
 
QVector3D direction () const
 Returns the direction of the ray see setDirection() More...
 
bool isInFront (const QVector3D &point) const
 Checks whether the point is in front of the ray. More...
 
QVector3D origin () const
 Returns the origin of the ray. More...
 
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) More...
 
void setDirection (const QVector3D direction)
 Sets the direction of the ray. More...
 
void setOrigin (const QVector3D &origin)
 Sets the origin of the ray. More...
 

Detailed Description

A representation of a ray in 3D.

A ray is composed of an origin point (the start of the ray) and a direction vector.

Since
QGIS 3.18

Definition at line 30 of file qgsray3d.h.

Constructor & Destructor Documentation

◆ QgsRay3D()

QgsRay3D::QgsRay3D ( const QVector3D &  origin,
const QVector3D &  direction 
)

Constructor.

Note
: the direction is automatically normalized

Definition at line 19 of file qgsray3d.cpp.

Member Function Documentation

◆ angleToPoint()

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 46 of file qgsray3d.cpp.

◆ direction()

QVector3D QgsRay3D::direction ( ) const
inline

Returns the direction of the ray see setDirection()

Definition at line 63 of file qgsray3d.h.

◆ isInFront()

bool QgsRay3D::isInFront ( const QVector3D &  point) const

Checks whether the point is in front of the ray.

Definition at line 41 of file qgsray3d.cpp.

◆ origin()

QVector3D QgsRay3D::origin ( ) const
inline

Returns the origin of the ray.

See also
setOrigin()

Definition at line 57 of file qgsray3d.h.

◆ projectedPoint()

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 36 of file qgsray3d.cpp.

◆ setDirection()

void QgsRay3D::setDirection ( const QVector3D  direction)

Sets the direction of the ray.

Note
: the direction is automatically normalized
See also
direction()

Definition at line 31 of file qgsray3d.cpp.

◆ setOrigin()

void QgsRay3D::setOrigin ( const QVector3D &  origin)

Sets the origin of the ray.

See also
origin()

Definition at line 26 of file qgsray3d.cpp.


The documentation for this class was generated from the following files: