Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (22 sloc) 446 Bytes
#include "Rays.hpp"
using namespace raytracer;
Ray::Ray(const Point& origin, const Vector direction, bool normalize):
origin(origin),direction(direction)
{
if(normalize)
{
this->direction.normalize();
}
}
const Point& Ray::get_origin() const
{
return origin;
}
const Vector& Ray::get_direction() const
{
return direction;
}
const Point Ray::get_point_at_t(float t) const
{
return origin + direction * t;
}