This repository has been archived on 2023-01-29. You can view files and clone it, but cannot push or open issues or pull requests.

20 lines
317 B
C++

#ifndef RAY_H
#define RAY_H
#include "vec3.h"
class ray
{
public:
ray() {}
ray(const vec3& a, const vec3& b) { A = a; B = b; }
vec3 origin() const { return A; }
vec3 direction() const { return B; }
vec3 point_at_parameter(float t) const { return A + t * B; }
vec3 A;
vec3 B;
};
#endif