init commit

This commit is contained in:
Moritz Gmeiner 2023-12-23 22:56:27 +01:00
commit a3e1542250
10 changed files with 360382 additions and 0 deletions

19
src/ray.h Normal file
View file

@ -0,0 +1,19 @@
#pragma once
#include "vec3.h"
class Ray {
public:
Ray() = default;
Ray(const Point3& origin, const Vec3& direction) : orig_{origin}, dir_{direction} {}
Point3 origin() const { return orig_; }
Vec3 direction() const { return dir_; }
Point3 At(double t) { return orig_ + t * dir_; }
private:
Point3 orig_;
Vec3 dir_;
};