[web] port JS code to Rust

This commit is contained in:
Emil Ernerfeldt
2020-07-18 13:30:23 +02:00
parent 8dced5896c
commit 0afad57d41
7 changed files with 554 additions and 392 deletions
+4
View File
@@ -30,6 +30,10 @@ impl Vec2 {
}
}
pub fn new(x: f32, y: f32) -> Self {
Self { x, y }
}
pub fn splat(v: impl Into<f32>) -> Self {
let v: f32 = v.into();
Self { x: v, y: v }