QGIS API Documentation 3.41.0-Master (3291e9ff48b)
Loading...
Searching...
No Matches
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.
 
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()
 
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 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.
 

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 50 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 44 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: