Use an internal colission cecker for better performance

This commit is contained in:
Manuel Vögele
2022-02-01 17:58:06 +01:00
parent 188f6c15bf
commit 9253f3decd
3 changed files with 152 additions and 16 deletions
-8
View File
@@ -19,14 +19,6 @@ extern "C" {
pub fn log(s: &str);
}
#[wasm_bindgen(
inline_js = "export function collidesWithWall(p1, p2) { return canvas.walls.checkCollision(new Ray(p1, p2));}"
)]
extern "C" {
#[wasm_bindgen(js_name=collidesWithWall)]
pub fn collides_with_wall(p1: Point, p2: Point) -> bool;
}
#[wasm_bindgen]
extern "C" {
pub type JsWall;