Always keep tokenSize/2 distance from walls

This commit is contained in:
Manuel Vögele
2022-02-02 10:36:03 +01:00
parent b55af992ec
commit 4d6543174a
3 changed files with 68 additions and 14 deletions
+2 -2
View File
@@ -74,13 +74,13 @@ impl Wall {
#[allow(dead_code)]
#[wasm_bindgen]
pub fn initialize(js_walls: Vec<JsValue>) -> Pathfinder {
pub fn initialize(js_walls: Vec<JsValue>, token_size: f64) -> Pathfinder {
let mut walls = Vec::with_capacity(js_walls.len());
for wall in js_walls {
let wall = JsWall::from(wall);
walls.push(Wall::from_js(&wall));
}
Pathfinder::initialize(walls)
Pathfinder::initialize(walls, token_size)
}
#[allow(dead_code)]