#ifndef WORLD_NAV_H #define WORLD_NAV_H /* * A coarse walking map of the site: which spots a person can't stand on * because something fixed is in the way (walls, trees, bushes, cars, * furniture). Used to find a way round when walking straight at something * leads into a corner. Rebuilt by itself when fixed things change. */ #include #include "world/object.h" #include "world/terrain.h" #define NAV_CELL 0.4f /* meters per cell */ #define NAV_PATH_MAX 24 /* waypoints in one way */ /* Rebuilds the map when fixed things were added, removed or moved. */ void Nav_update(Object *const *objects, int count, const Terrain *terrain); /* Can a person stand here (as far as fixed things go)? */ bool Nav_free(Vec3 p); /* * A way from `from` to `to` round fixed things: waypoints after the start, * the last one at `to` (or the nearest free spot by it). Returns how many * (0: no way, or the map isn't built). */ int Nav_findPath(Vec3 from, Vec3 to, Vec3 *out, int max); #endif /* WORLD_NAV_H */