diff --git a/rtiow/src/vec3.rs b/rtiow/src/vec3.rs index cdd9dab..6caccfe 100644 --- a/rtiow/src/vec3.rs +++ b/rtiow/src/vec3.rs @@ -71,6 +71,18 @@ impl str::FromStr for Vec3 { } } +impl Add for Vec3 { + type Output = Vec3; + + fn add(self, r: f32) -> Vec3 { + Vec3 { + x: self.x + r, + y: self.y + r, + z: self.z + r, + } + } +} + impl Add for Vec3 { type Output = Vec3;