mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
More tolerant pathfinding
This commit is contained in:
committed by
jshipsey
parent
db26c10299
commit
177bd7a128
@ -266,7 +266,10 @@ where
|
||||
.map(move |(dir, _)| pos + *dir),
|
||||
)
|
||||
};
|
||||
let transition = |_: &Vec3<i32>, _: &Vec3<i32>| 1.0;
|
||||
let transition = |a: &Vec3<i32>, b: &Vec3<i32>| {
|
||||
((*a - *b) * Vec3::new(1, 1, 3)).map(|e| e.abs()).reduce_max() as f32
|
||||
+ endf.distance((*b).map(|e| e as f32)) * 0.01
|
||||
};
|
||||
let satisfied = |pos: &Vec3<i32>| pos == &end;
|
||||
|
||||
let mut new_astar = match astar.take() {
|
||||
|
Reference in New Issue
Block a user