This repository has been archived on 2023-01-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
1weekendraytracer/code/ray.h
2019-01-15 18:11:20 +01:00

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