Pyrogenesis
trunk
|
#include <LongPathfinder.h>
Public Member Functions | |
LongPathfinder () | |
~LongPathfinder () | |
void | SetDebugOverlay (bool enabled) |
void | SetHierDebugOverlay (bool enabled, const CSimContext *simContext) |
void | SetDebugPath (entity_pos_t x0, entity_pos_t z0, const PathGoal &goal, pass_class_t passClass) |
void | Reload (Grid< NavcellData > *passabilityGrid, const std::map< std::string, pass_class_t > &nonPathfindingPassClassMasks, const std::map< std::string, pass_class_t > &pathfindingPassClassMasks) |
void | Update (Grid< NavcellData > *passabilityGrid, const Grid< u8 > &dirtinessGrid) |
void | HierarchicalRenderSubmit (SceneCollector &collector) |
void | ComputePath (entity_pos_t x0, entity_pos_t z0, const PathGoal &origGoal, pass_class_t passClass, WaypointPath &path) |
Compute a tile-based path from the given point to the goal, and return the set of waypoints. More... | |
void | ComputePath (entity_pos_t x0, entity_pos_t z0, const PathGoal &origGoal, pass_class_t passClass, std::vector< CircularRegion > excludedRegions, WaypointPath &path) |
Compute a tile-based path from the given point to the goal, excluding the regions specified in excludedRegions (which are treated as impassable) and return the set of waypoints. More... | |
Grid< u16 > | GetConnectivityGrid (pass_class_t passClass) |
void | GetDebugData (u32 &steps, double &time, Grid< u8 > &grid) const |
Public Attributes | |
Grid< NavcellData > * | m_Grid |
u16 | m_GridSize |
LongOverlay * | m_DebugOverlay |
PathfindTileGrid * | m_DebugGrid |
u32 | m_DebugSteps |
double | m_DebugTime |
PathGoal | m_DebugGoal |
WaypointPath * | m_DebugPath |
pass_class_t | m_DebugPassClass |
Private Member Functions | |
PathCost | CalculateHeuristic (int i, int j, int iGoal, int jGoal) |
void | ProcessNeighbour (int pi, int pj, int i, int j, PathCost pg, PathfinderState &state) |
void | AddJumpedHoriz (int i, int j, int di, PathCost g, PathfinderState &state, bool detectGoal) |
JPS algorithm helper functions. More... | |
int | HasJumpedHoriz (int i, int j, int di, PathfinderState &state, bool detectGoal) |
void | AddJumpedVert (int i, int j, int dj, PathCost g, PathfinderState &state, bool detectGoal) |
int | HasJumpedVert (int i, int j, int dj, PathfinderState &state, bool detectGoal) |
void | AddJumpedDiag (int i, int j, int di, int dj, PathCost g, PathfinderState &state) |
void | ComputeJPSPath (entity_pos_t x0, entity_pos_t z0, const PathGoal &origGoal, pass_class_t passClass, WaypointPath &path) |
See LongPathfinder.cpp for implementation details TODO: cleanup documentation. More... | |
void | GetDebugDataJPS (u32 &steps, double &time, Grid< u8 > &grid) const |
void | ImprovePathWaypoints (WaypointPath &path, pass_class_t passClass, entity_pos_t maxDist, entity_pos_t x0, entity_pos_t z0) |
Given a path with an arbitrary collection of waypoints, updates the waypoints to be nicer. More... | |
void | GenerateSpecialMap (pass_class_t passClass, std::vector< CircularRegion > excludedRegions) |
Generate a passability map, stored in the 16th bit of navcells, based on passClass, but with a set of impassable circular regions. More... | |
Private Attributes | |
bool | m_UseJPSCache |
std::map< pass_class_t, shared_ptr< JumpPointCache > > | m_JumpPointCache |
HierarchicalPathfinder | m_PathfinderHier |
LongPathfinder::LongPathfinder | ( | ) |
LongPathfinder::~LongPathfinder | ( | ) |
|
private |
|
private |
JPS algorithm helper functions.
detectGoal | is not used if m_UseJPSCache is true |
|
private |
|
private |
|
private |
See LongPathfinder.cpp for implementation details TODO: cleanup documentation.
|
inline |
Compute a tile-based path from the given point to the goal, and return the set of waypoints.
The waypoints correspond to the centers of horizontally/vertically adjacent tiles along the path.
void LongPathfinder::ComputePath | ( | entity_pos_t | x0, |
entity_pos_t | z0, | ||
const PathGoal & | origGoal, | ||
pass_class_t | passClass, | ||
std::vector< CircularRegion > | excludedRegions, | ||
WaypointPath & | path | ||
) |
Compute a tile-based path from the given point to the goal, excluding the regions specified in excludedRegions (which are treated as impassable) and return the set of waypoints.
The waypoints correspond to the centers of horizontally/vertically adjacent tiles along the path.
|
private |
Generate a passability map, stored in the 16th bit of navcells, based on passClass, but with a set of impassable circular regions.
|
inline |
|
private |
|
private |
|
private |
|
inline |
|
private |
Given a path with an arbitrary collection of waypoints, updates the waypoints to be nicer.
Calls "Testline" between waypoints 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
maxDist | is non-zero, path waypoints will be espaced by at most |
maxDist. | In that case the distance between (x0, z0) and the first waypoint will also be made less than maxDist. |
|
private |
|
inline |
void LongPathfinder::SetDebugOverlay | ( | bool | enabled | ) |
|
inline |
|
inline |
|
inline |
PathGoal LongPathfinder::m_DebugGoal |
PathfindTileGrid* LongPathfinder::m_DebugGrid |
LongOverlay* LongPathfinder::m_DebugOverlay |
pass_class_t LongPathfinder::m_DebugPassClass |
WaypointPath* LongPathfinder::m_DebugPath |
u32 LongPathfinder::m_DebugSteps |
double LongPathfinder::m_DebugTime |
Grid<NavcellData>* LongPathfinder::m_Grid |
u16 LongPathfinder::m_GridSize |
|
private |
|
private |
|
private |