Thea
Public Types | Public Member Functions | List of all members
RayN< N, T > Class Template Reference

A ray in N-dimensional space, having an originating point and a direction vector (not necessarily unit length). More...

#include <RayN.hpp>

Public Types

typedef Vector< N, T > VectorT
 N-dimensional vector. More...
 

Public Member Functions

template<typename U >
RayN< N, U > cast () const
 Cast the ray to a different scalar type. More...
 
VectorT closestPoint (VectorT const &p) const
 Get the the point on the ray closest to a given point. More...
 
distance (VectorT const &p) const
 Get the distance of a point from the ray. More...
 
VectorT const & getDirection () const
 Get the direction of the ray. More...
 
VectorT const & getOrigin () const
 Get the origin of the ray. More...
 
VectorT getPoint (T const &t) const
 Get a parametrized point on the ray. More...
 
void normalizeDirection ()
 Make the direction vector unit length. More...
 
 RayN ()
 Default constructor. More...
 
 RayN (VectorT const &origin_, VectorT const &direction_)
 Initialize with an origin and a direction. More...
 
 RayN (RayN const &src)
 Copy constructor. More...
 
void setDirection (VectorT const &direction_)
 Set the direction of the ray. More...
 
void setOrigin (VectorT const &origin_)
 Set the origin of the ray. More...
 
squaredDistance (VectorT const &p) const
 Get the square of the distance of a point from the ray. More...
 
RayN toObjectSpace (CoordinateFrameN< N, T > const &frame) const
 Transform the ray from world space into a local frame. More...
 
std::string toString () const
 Get a textual representation of the ray. More...
 
RayN toWorldSpace (CoordinateFrameN< N, T > const &frame) const
 Transform the ray out of a local frame to world space. More...
 
RayN transform (AffineTransformN< N, T > const &tr) const
 Apply an arbitrary affine transform to the ray. More...
 

Detailed Description

template<int N, typename T = Real>
class Thea::RayN< N, T >

A ray in N-dimensional space, having an originating point and a direction vector (not necessarily unit length).

Definition at line 27 of file RayN.hpp.

Member Typedef Documentation

typedef Vector<N, T> VectorT

N-dimensional vector.

Definition at line 32 of file RayN.hpp.

Constructor & Destructor Documentation

RayN ( )

Default constructor.

Does not initialize anything.

Definition at line 35 of file RayN.hpp.

RayN ( VectorT const &  origin_,
VectorT const &  direction_ 
)

Initialize with an origin and a direction.

The direction will NOT be normalized.

Definition at line 38 of file RayN.hpp.

RayN ( RayN< N, T > const &  src)

Copy constructor.

Definition at line 41 of file RayN.hpp.

Member Function Documentation

RayN<N, U> cast ( ) const

Cast the ray to a different scalar type.

Definition at line 44 of file RayN.hpp.

VectorT closestPoint ( VectorT const &  p) const

Get the the point on the ray closest to a given point.

Definition at line 96 of file RayN.hpp.

T distance ( VectorT const &  p) const

Get the distance of a point from the ray.

Definition at line 90 of file RayN.hpp.

VectorT const& getDirection ( ) const

Get the direction of the ray.

Definition at line 56 of file RayN.hpp.

VectorT const& getOrigin ( ) const

Get the origin of the ray.

Definition at line 50 of file RayN.hpp.

VectorT getPoint ( T const &  t) const

Get a parametrized point on the ray.

Returns
getOrigin() + t * getDirection()

Definition at line 87 of file RayN.hpp.

void normalizeDirection ( )

Make the direction vector unit length.

Definition at line 62 of file RayN.hpp.

void setDirection ( VectorT const &  direction_)

Set the direction of the ray.

The direction will NOT be normalized.

Definition at line 59 of file RayN.hpp.

void setOrigin ( VectorT const &  origin_)

Set the origin of the ray.

Definition at line 53 of file RayN.hpp.

T squaredDistance ( VectorT const &  p) const

Get the square of the distance of a point from the ray.

Definition at line 93 of file RayN.hpp.

RayN toObjectSpace ( CoordinateFrameN< N, T > const &  frame) const

Transform the ray from world space into a local frame.

Definition at line 71 of file RayN.hpp.

std::string toString ( ) const

Get a textual representation of the ray.

Definition at line 114 of file RayN.hpp.

RayN toWorldSpace ( CoordinateFrameN< N, T > const &  frame) const

Transform the ray out of a local frame to world space.

Definition at line 65 of file RayN.hpp.

RayN transform ( AffineTransformN< N, T > const &  tr) const

Apply an arbitrary affine transform to the ray.

Definition at line 77 of file RayN.hpp.


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