From f467334b26f31b19ebbd222de2b4167b1538ccee Mon Sep 17 00:00:00 2001 From: Julian T Date: Thu, 28 Jan 2021 23:53:56 +0100 Subject: Unfinished film --- src/vector.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/vector.rs') diff --git a/src/vector.rs b/src/vector.rs index 9b89168..ff443f5 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -30,6 +30,25 @@ impl Sub for Vector2 { } } +impl From for Vector2f { + fn from(v: Vector2i) -> Self { + Self { + x: v.x as Float, + y: v.y as Float, + } + } +} + +impl From for Vector2i { + fn from(v: Vector2f) -> Self { + Self { + x: v.x as i32, + y: v.y as i32, + } + } +} + + #[cfg(test)] mod tests { use super::*; -- cgit v1.2.3