Add support for the wall height module in the gridless pathfinder
This commit is contained in:
@@ -148,7 +148,7 @@ pub struct Pathfinder {
|
||||
}
|
||||
|
||||
impl Pathfinder {
|
||||
pub fn initialize<I>(walls: I, token_size: f64) -> Self
|
||||
pub fn initialize<I>(walls: I, token_size: f64, token_elevation: f64) -> Self
|
||||
where
|
||||
I: IntoIterator<Item = Wall>,
|
||||
{
|
||||
@@ -162,6 +162,9 @@ impl Pathfinder {
|
||||
if wall.is_door() && wall.is_open() {
|
||||
continue;
|
||||
}
|
||||
if !wall.height.contains(token_elevation) {
|
||||
continue;
|
||||
}
|
||||
let x_diff = wall.p2.x - wall.p1.x;
|
||||
let y_diff = wall.p2.y - wall.p1.y;
|
||||
let p1_angle = y_diff.atan2(x_diff).rem_euclid(2.0 * PI);
|
||||
|
||||
Reference in New Issue
Block a user