aboutsummaryrefslogtreecommitdiff
path: root/lib/hittable.rb
diff options
context:
space:
mode:
authorNat Lasseter <user@4574.co.uk>2024-06-12 23:19:56 +0100
committerNat Lasseter <user@4574.co.uk>2024-06-12 23:19:56 +0100
commit523f9439ed0d2e4c2d51edc623b6c4d62885cfdd (patch)
tree38a5f147ed09b90f3f6d395f91c5254c40be2854 /lib/hittable.rb
parent1bc4829392b3c91737fbe4ddccd81098ac9d8a12 (diff)
Finished chapter 9
Diffstat (limited to 'lib/hittable.rb')
-rw-r--r--lib/hittable.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hittable.rb b/lib/hittable.rb
index 80254d1..c84764f 100644
--- a/lib/hittable.rb
+++ b/lib/hittable.rb
@@ -8,8 +8,8 @@ class HitRecord
attr_accessor :point, :normal, :t
def set_face_normal(ray, out_normal)
- @front_face = ray.direction.dot(out_normal) < 0
- @normal = @front_face ? out_normal : -out_normal
+ front_face = ray.direction.dot(out_normal) < 0
+ @normal = front_face ? out_normal : -out_normal
end
end