cgv
Loading...
Searching...
No Matches
cgv::math::ray< T, N > Class Template Reference

This class defines a template for n-dimensional rays with arbitrary data type defined by origin and direction. More...

#include <ray.h>

Public Member Functions

 ray ()
 Construct an invalid ray with origin at zero and undefined direction.
 
 ray (const fvec< T, N > &origin, const fvec< T, N > &direction)
 Construct a ray with given origin and direction.
 
fvec< T, N > position (float t) const
 Returns the position of the ray at the given distance (ray parameter t) from its origin.
 

Public Attributes

fvec< T, N > origin
 
fvec< T, N > direction
 

Detailed Description

template<typename T, cgv::type::uint32_type N>
class cgv::math::ray< T, N >

This class defines a template for n-dimensional rays with arbitrary data type defined by origin and direction.

Definition at line 14 of file ray.h.

Constructor & Destructor Documentation

◆ ray() [1/2]

template<typename T , cgv::type::uint32_type N>
cgv::math::ray< T, N >::ray ( )
inline

Construct an invalid ray with origin at zero and undefined direction.

Definition at line 20 of file ray.h.

◆ ray() [2/2]

template<typename T , cgv::type::uint32_type N>
cgv::math::ray< T, N >::ray ( const fvec< T, N > &  origin,
const fvec< T, N > &  direction 
)
inline

Construct a ray with given origin and direction.

Definition at line 26 of file ray.h.

Member Function Documentation

◆ position()

template<typename T , cgv::type::uint32_type N>
fvec< T, N > cgv::math::ray< T, N >::position ( float  t) const
inline

Returns the position of the ray at the given distance (ray parameter t) from its origin.

Definition at line 29 of file ray.h.

Member Data Documentation

◆ direction

template<typename T , cgv::type::uint32_type N>
fvec<T, N> cgv::math::ray< T, N >::direction

Definition at line 17 of file ray.h.

◆ origin

template<typename T , cgv::type::uint32_type N>
fvec<T, N> cgv::math::ray< T, N >::origin

Definition at line 16 of file ray.h.


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