cesium-native 0.43.0
Loading...
Searching...
No Matches
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.
 
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.
 
Ray transform (const glm::dmat4x4 &transformation) const noexcept
 Transforms the ray using a given 4x4 transformation matrix.
 
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::exception`direction` must be normalized.

Member Function Documentation

◆ getDirection()

const glm::dvec3 & CesiumGeometry::Ray::getDirection ( ) const
inlinenoexcept

Gets the direction of the ray.

Definition at line 34 of file Ray.h.

◆ getOrigin()

const glm::dvec3 & CesiumGeometry::Ray::getOrigin ( ) const
inlinenoexcept

Gets the origin of the ray.

Definition at line 29 of file Ray.h.

◆ 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: