veloren_world/pathfinding.rs
1use crate::sim::WorldSim;
2use common::path::Path;
3//use hashbrown::hash_map::DefaultHashBuilder;
4use vek::*;
5
6#[expect(dead_code)]
7pub struct SearchCfg {
8 // 0.0 = no discount, 1.0 = free travel
9 path_discount: f32,
10 // Cost per metre altitude change per metre horizontal
11 // 0.0 = no cost, 1.0 = same cost vertical as horizontal
12 gradient_aversion: f32,
13}
14
15#[expect(dead_code)]
16pub struct Searcher<'a> {
17 land: &'a WorldSim,
18 pub cfg: SearchCfg,
19}
20
21impl Searcher<'_> {
22 /// Attempt to find a path between two chunks on the map.
23 pub fn search(self, _a: Vec2<i32>, _b: Vec2<i32>) -> Option<Path<i32>> {
24 // TODO: implement this function
25
26 //let heuristic = |pos: &Vec2<i32>| (pos - b).map(|e| e as f32).magnitude();
27 // Astar::new(
28 // 100_000,
29 // a,
30 // heuristc,
31 // DefaultHashBuilder::default(),
32 // );
33
34 None
35 }
36}