Core 1.0
Public Member Functions | Protected Attributes | Friends | List of all members
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. More...
 
 ~Ray2 ()
 Empty.
 
Vector2 operator() (const double &) const
 Computes the location of a vertex along the ray. More...
 
Vector2 Origin () const
 Return the origin of the ray.
 
Vector2 Direction () const
 Return the direction of the ray.
 

Protected Attributes

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

Friends

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

Detailed Description

A ray characterized by its origin an unit direction vector.

Constructor & Destructor Documentation

◆ Ray2()

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

Creates a ray.

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

Member Function Documentation

◆ operator()()

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

Computes the location of a vertex along the ray.

Parameters
tParameter.

Friends And Related Function Documentation

◆ operator<<

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

Overloaded.

Parameters
sStream.
rayThe ray.