Core 1.0
Ray2 Class Reference

A ray characterized by its origin an unit direction vector. More...

#include <ray.h>

Public Member Functions

 Ray2 ()
 Empty.
 
 Ray2 (const Vector2 &, const Vector2 &)
 Creates a ray.
 
 Ray2 (const Ray &)
 Creates a ray.
 
 ~Ray2 ()
 Empty.
 
Vector2 operator() (const double &) const
 Computes the location of a vertex along the ray.
 
Vector2 Origin () const
 Return the origin of the ray.
 
Vector2 Direction () const
 Return the direction of the ray.
 
Ray2 InverseTransform (const Frame2 &) const
 Transform a ray.
 

Protected Attributes

Vector2 c = Vector2::Null
 Origin of the ray.
 
Vector2 n = Vector2::X
 Direction.
 

Friends

std::ostream & operator<< (std::ostream &s, const Ray2 &ray)
 Overloaded.
 

Detailed Description

A ray characterized by its origin an unit direction vector.

Constructor & Destructor Documentation

◆ Ray2() [1/2]

Ray2::Ray2 ( const Vector2 & p,
const Vector2 & d )
inlineexplicit

Creates a ray.

See also
Ray::Ray
Parameters
pOrigin.
dDirection (should be unit vector).

◆ Ray2() [2/2]

Ray2::Ray2 ( const Ray & ray)
inlineexplicit

Creates a ray.

The direction is normalized automatically.

Parameters
rayRay in three dimensions.

Member Function Documentation

◆ InverseTransform()

Ray2 Ray2::InverseTransform ( const Frame2 & frame) const

Transform a ray.

Parameters
frameThe frame.

◆ operator()()

Vector2 Ray2::operator() ( const double & t) const
inline

Computes the location of a vertex along the ray.

Parameters
tParameter.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const Ray2 & ray )
friend

Overloaded.

Parameters
sStream.
rayThe ray.