diff options
Diffstat (limited to 'lib/ray.rb')
-rw-r--r-- | lib/ray.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ray.rb b/lib/ray.rb new file mode 100644 index 0000000..4d282cb --- /dev/null +++ b/lib/ray.rb @@ -0,0 +1,12 @@ +class Ray + def initialize(origin = Point.new, direction = Vec3.new) + @origin = origin + @direction = direction + end + + attr_reader :origin, :direction + + def at(time) + @origin + (@direction * time) + end +end |