mirror of
https://github.com/MorizzG/ray-tracer.git
synced 2025-12-06 04:22:42 +00:00
init commit
This commit is contained in:
commit
a3e1542250
10 changed files with 360382 additions and 0 deletions
19
src/ray.h
Normal file
19
src/ray.h
Normal 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_;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue