Remove deprecatd emscripten option ERROR_ON_MISSING_LIBRARIES
[mandelwow.git] / support / vec3.rs
index 85d3cc34a79c98e0274befc0681884edbcae0463..175c7fd83293360799d27b27666143a302b8fbae 100644 (file)
@@ -1,13 +1,12 @@
-extern crate glutin;
-
 use std::f32;
 use std::ops::Add;
 use std::ops::AddAssign;
 use std::ops::Sub;
+use std::ops::SubAssign;
 use std::ops::Mul;
 
 #[derive(Default, PartialEq, Debug, Clone, Copy)]
-pub struct Vec3 (pub f32, pub f32, pub f32);
+pub struct Vec3(pub f32, pub f32, pub f32);
 
 impl Add for Vec3 {
     type Output = Vec3;
@@ -29,6 +28,12 @@ impl Sub for Vec3 {
     }
 }
 
+impl SubAssign for Vec3 {
+    fn sub_assign(&mut self, other: Vec3) {
+        *self = Vec3(self.0 - other.0, self.1 - other.1, self.2 - other.2)
+    }
+}
+
 impl Mul<f32> for Vec3 {
     type Output = Vec3;
     fn mul(self, f: f32) -> Vec3 {