From 523f9439ed0d2e4c2d51edc623b6c4d62885cfdd Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Wed, 12 Jun 2024 23:19:56 +0100 Subject: Finished chapter 9 --- lib/hittable.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/hittable.rb') 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 -- cgit v1.2.1