diff options
author | Julian T <julian@jtle.dk> | 2021-01-28 23:53:56 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-01-28 23:53:56 +0100 |
commit | f467334b26f31b19ebbd222de2b4167b1538ccee (patch) | |
tree | f58839dde3f299a7c67aa37f9c86bcf36aa4186e /src/vector.rs | |
parent | 33a35c50c20e863123642c8c9ea31dfc006945f6 (diff) |
Unfinished film
Diffstat (limited to 'src/vector.rs')
-rw-r--r-- | src/vector.rs | 19 |
1 files changed, 19 insertions, 0 deletions
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<T: Number> Sub for Vector2<T> { } } +impl From<Vector2i> for Vector2f { + fn from(v: Vector2i) -> Self { + Self { + x: v.x as Float, + y: v.y as Float, + } + } +} + +impl From<Vector2f> for Vector2i { + fn from(v: Vector2f) -> Self { + Self { + x: v.x as i32, + y: v.y as i32, + } + } +} + + #[cfg(test)] mod tests { use super::*; |