From 33e747fa1c0957546c10e4d7b490ac7fbb0fd2d2 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 7 Feb 2021 14:25:06 +0100 Subject: Abstracted lambertian into material --- src/core/spectrum.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/spectrum.rs') diff --git a/src/core/spectrum.rs b/src/core/spectrum.rs index 727a1b6..9cca7dc 100644 --- a/src/core/spectrum.rs +++ b/src/core/spectrum.rs @@ -41,6 +41,18 @@ impl std::ops::Mul for Spectrum { } } +impl std::ops::Mul for Spectrum { + type Output = Spectrum; + + fn mul(self, op: Self) -> Self::Output { + Self::Output::new_rgb( + self.c[0] * op.c[0], + self.c[1] * op.c[1], + self.c[2] * op.c[2], + ) + } +} + impl std::ops::Div for Spectrum { type Output = Spectrum; -- cgit v1.2.3