From c24d1e52b3f173ba5f4cc04f5a6a449a011a60c7 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 7 Feb 2021 17:52:30 +0100 Subject: Add reflecting material --- src/core/vector3.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/core/vector3.rs') diff --git a/src/core/vector3.rs b/src/core/vector3.rs index ff5a678..9d6c1cf 100644 --- a/src/core/vector3.rs +++ b/src/core/vector3.rs @@ -2,7 +2,7 @@ //! //! Also add more 3d math things needed for shading and 3d calculations. use crate::{Float, Number, NEAR_ZERO}; -use std::ops::{Mul, Sub, Add, DivAssign, Neg}; +use std::ops::{Mul, Sub, Add, DivAssign, Neg, AddAssign}; use std::fmt; #[derive(Clone, Copy)] @@ -85,6 +85,14 @@ impl Neg for Vector3 { } } +impl AddAssign<&Self> for Vector3 { + fn add_assign(&mut self, op: &Self) { + self.x += op.x; + self.y += op.y; + self.z += op.z; + } +} + impl DivAssign for Vector3 { fn div_assign(&mut self, op: T) { self.x /= op; -- cgit v1.2.3