From 4014436905aace9acd47dde245b88bd5f69335ec Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Mon, 9 Mar 2026 23:31:27 +0800 Subject: Sending Rays Into the Scene --- src/ray.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/ray.h (limited to 'src/ray.h') diff --git a/src/ray.h b/src/ray.h new file mode 100644 index 0000000..d9c42dc --- /dev/null +++ b/src/ray.h @@ -0,0 +1,22 @@ +#ifndef RAY_H +#define RAY_H + +#include "vec3.h" + +class ray +{ +public: + ray() {} + ray( const point3& origin, const vec3& direction ) : orig( origin ), dir( direction ) {} + + const point3& origin() const; + const vec3& direction() const; + + point3 at( double t ) const; + +private: + point3 orig; + vec3 dir; +}; + +#endif \ No newline at end of file -- cgit v1.2.3