cesium-native  0.41.0
CesiumGeometry::Ray Class Referencefinal

A ray that extends infinitely from the provided origin in the provided direction. More...

#include <CesiumGeometry/Ray.h>

Public Member Functions

 Ray (const glm::dvec3 &origin, const glm::dvec3 &direction)
 Construct a new ray. More...
 
const glm::dvec3 & getOrigin () const noexcept
 Gets the origin of the ray.
 
const glm::dvec3 & getDirection () const noexcept
 Gets the direction of the ray.
 
glm::dvec3 pointFromDistance (double distance) const noexcept
 Calculates a point on the ray that corresponds to the given distance from origin. Can be positive, negative, or 0. More...
 
Ray transform (const glm::dmat4x4 &transformation) const noexcept
 Transforms the ray using a given 4x4 transformation matrix. More...
 
Ray operator- () const noexcept
 Constructs a new ray with its direction opposite this one.
 

Detailed Description

A ray that extends infinitely from the provided origin in the provided direction.

Definition at line 14 of file Ray.h.

Constructor & Destructor Documentation

◆ Ray()

CesiumGeometry::Ray::Ray ( const glm::dvec3 &  origin,
const glm::dvec3 &  direction 
)

Construct a new ray.

Parameters
originThe origin of the ray.
directionThe direction of the ray (normalized).
Exceptions
std::exceptiondirection must be normalized.

Member Function Documentation

◆ pointFromDistance()

glm::dvec3 CesiumGeometry::Ray::pointFromDistance ( double  distance) const
noexcept

Calculates a point on the ray that corresponds to the given distance from origin. Can be positive, negative, or 0.

Parameters
distanceDesired distance from origin
Returns
The point along the ray.

◆ transform()

Ray CesiumGeometry::Ray::transform ( const glm::dmat4x4 &  transformation) const
noexcept

Transforms the ray using a given 4x4 transformation matrix.

Parameters
transformationThe 4x4 transformation matrix used to transform the ray.
Returns
The transformed ray.

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