aboutsummaryrefslogtreecommitdiffstats
path: root/src/metal.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2020-12-21 23:13:25 +0100
committerladevieq <ladevie.quentin@gmail.com>2020-12-21 23:13:25 +0100
commit8da53c5f262b09756e1a93257cdcd5be25807839 (patch)
treec34344074ca8766dafcbf27958f571bf14c35315 /src/metal.cpp
parent56bed8e38f5b6d9effd77371ad781ae71601205b (diff)
Movable and rotatable camera + dielectric materials
Diffstat (limited to 'src/metal.cpp')
-rw-r--r--src/metal.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/metal.cpp b/src/metal.cpp
index d02a2f7..196c95d 100644
--- a/src/metal.cpp
+++ b/src/metal.cpp
@@ -6,7 +6,7 @@ metal::metal(const color& albedo, double f)
: albedo(albedo), fuzz(f < 1 ? f : 1) {}
bool metal::scatter(const ray& r, const struct hit_info& info, color& attenuation, ray& scattered) const {
- auto reflected = reflect(r.direction, info.normal).unit();
+ auto reflected = reflect(r.direction.unit(), info.normal);
scattered = ray { info.point, reflected + fuzz * random_in_unit_sphere() };
attenuation = albedo;