Only collide with walls from the front
[kaka/rust-sdl-test.git] / src / geometry.rs
index 2d5a70c..7ddc3ec 100644 (file)
@@ -38,6 +38,10 @@ impl Point<f64> {
            y: self.y as i32,
        }
     }
+
+    pub fn cross_product(&self, p: Self) -> f64 {
+        return self.x * p.y - self.y * p.x;
+    }
 }
 
 macro_rules! impl_point_op {