18 lines
324 B
C++
18 lines
324 B
C++
|
|
#include <stdlib.h> /* rand() */
|
|
|
|
#include <iostream>
|
|
|
|
#include "Ray.h"
|
|
|
|
Ray Ray::randomRay()
|
|
{
|
|
return Ray(Vector(0, 0, 0), Vector::randomVector());
|
|
}
|
|
|
|
std::ostream & operator<<(std::ostream & out, const Ray & r)
|
|
{
|
|
out << "(" << r.getOrigin() << " -> " << r.getDirection() << ")";
|
|
return out;
|
|
}
|