blob: 4d282cb7f4423f95c5919bc85556e8dc1cd9fffb (
plain)
1
2
3
4
5
6
7
8
9
10
11
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
|