Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/helpers/LongPathfinder.h
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | private: | ||||
*/ | */ | ||||
void ComputeJPSPath(const HierarchicalPathfinder& hierPath, entity_pos_t x0, entity_pos_t z0, const PathGoal& origGoal, pass_class_t passClass, WaypointPath& path) const; | void ComputeJPSPath(const HierarchicalPathfinder& hierPath, entity_pos_t x0, entity_pos_t z0, const PathGoal& origGoal, pass_class_t passClass, WaypointPath& path) const; | ||||
void GetDebugDataJPS(u32& steps, double& time, Grid<u8>& grid) const; | void GetDebugDataJPS(u32& steps, double& time, Grid<u8>& grid) const; | ||||
// Helper functions for ComputePath | // Helper functions for ComputePath | ||||
/** | /** | ||||
* Given a path with an arbitrary collection of waypoints, updates the | * Given a path with an arbitrary collection of waypoints, updates the | ||||
* waypoints to be nicer. Calls "Testline" between waypoints | * waypoints to be nicer. | ||||
* so that bended paths can become straight if there's nothing in between | |||||
* (this happens because A* is 8-direction, and the map isn't actually a grid). | |||||
* If @param maxDist is non-zero, path waypoints will be espaced by at most @param maxDist. | * If @param maxDist is non-zero, path waypoints will be espaced by at most @param maxDist. | ||||
* In that case the distance between (x0, z0) and the first waypoint will also be made less than maxDist. | * In that case the distance between (x0, z0) and the first waypoint will also be made less than maxDist. | ||||
*/ | */ | ||||
void ImprovePathWaypoints(WaypointPath& path, pass_class_t passClass, entity_pos_t maxDist, entity_pos_t x0, entity_pos_t z0) const; | void ImprovePathWaypoints(WaypointPath& path, pass_class_t passClass, entity_pos_t maxDist, entity_pos_t x0, entity_pos_t z0) const; | ||||
/** | /** | ||||
* Generate a passability map, stored in the 16th bit of navcells, based on passClass, | * Generate a passability map, stored in the 16th bit of navcells, based on passClass, | ||||
* but with a set of impassable circular regions. | * but with a set of impassable circular regions. | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator