Implement Vec3 + f32

This commit is contained in:
Bill Thiede 2018-09-08 21:52:49 -07:00
parent 5ca6cc0809
commit 20c79a655b

View File

@ -71,6 +71,18 @@ impl str::FromStr for Vec3 {
}
}
impl Add<f32> 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;