#include <HierarchicalPathfinder.h>
|
| HierarchicalPathfinder () |
|
| ~HierarchicalPathfinder () |
|
void | SetDebugOverlay (bool enabled, const CSimContext *simContext) |
|
void | Recompute (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 > *grid, const Grid< u8 > &dirtinessGrid) |
|
RegionID | Get (u16 i, u16 j, pass_class_t passClass) const |
|
GlobalRegionID | GetGlobalRegion (u16 i, u16 j, pass_class_t passClass) const |
|
GlobalRegionID | GetGlobalRegion (RegionID region, pass_class_t passClass) const |
|
bool | MakeGoalReachable (u16 i0, u16 j0, PathGoal &goal, pass_class_t passClass) const |
| Updates goal so that it's guaranteed to be reachable from the navcell i0 , j0 (which is assumed to be on a passable navcell). More...
|
|
bool | IsGoalReachable (u16 i0, u16 j0, const PathGoal &goal, pass_class_t passClass) const |
|
void | FindNearestPassableNavcell (u16 &i, u16 &j, pass_class_t passClass) const |
| Updates i , j (which is assumed to be an impassable navcell) to the nearest passable navcell. More...
|
|
Grid< u16 > | GetConnectivityGrid (pass_class_t passClass) const |
| Generates the connectivity grid associated with the given pass_class. More...
|
|
pass_class_t | GetPassabilityClass (const std::string &name) const |
|
void | RenderSubmit (SceneCollector &collector) |
|
|
const Chunk & | GetChunk (u8 ci, u8 cj, pass_class_t passClass) const |
|
void | ComputeNeighbors (EdgesMap &edges, Chunk &a, Chunk &b, bool transpose, bool opposite) const |
|
void | RecomputeAllEdges (pass_class_t passClass, EdgesMap &edges) |
| Find edges between regions in all chunks, in an optimised manner (only look at top/left) More...
|
|
void | UpdateEdges (u8 ci, u8 cj, pass_class_t passClass, EdgesMap &edges) |
| Connect a chunk's regions to their neighbors. More...
|
|
void | UpdateGlobalRegions (const std::map< pass_class_t, std::vector< RegionID > > &needNewGlobalRegionMap) |
|
template<typename Ordering > |
void | FindReachableRegions (RegionID from, std::set< RegionID, Ordering > &reachable, pass_class_t passClass) const |
| Returns all reachable regions, optionally ordered in a specific manner. More...
|
|
void | FindNearestNavcellInRegions (const std::set< RegionID, SortByCenterToPoint > ®ions, u16 &iGoal, u16 &jGoal, pass_class_t passClass) const |
|
void | FindGoalRegionsAndBestNavcells (u16 i0, u16 j0, u16 gi, u16 gj, const PathGoal &goal, std::set< InterestingRegion, SortByBestToPoint > ®ions, pass_class_t passClass) const |
|
void | FillRegionOnGrid (const RegionID ®ion, pass_class_t passClass, u16 value, Grid< u16 > &grid) const |
|
void | AddDebugEdges (pass_class_t passClass) |
| Debug visualisation of graph edges between regions. More...
|
|
◆ EdgesMap
◆ GlobalRegionID
◆ HierarchicalPathfinder()
HierarchicalPathfinder::HierarchicalPathfinder |
( |
| ) |
|
◆ ~HierarchicalPathfinder()
HierarchicalPathfinder::~HierarchicalPathfinder |
( |
| ) |
|
◆ AddDebugEdges()
void HierarchicalPathfinder::AddDebugEdges |
( |
pass_class_t |
passClass | ) |
|
|
private |
Debug visualisation of graph edges between regions.
◆ ComputeNeighbors()
void HierarchicalPathfinder::ComputeNeighbors |
( |
EdgesMap & |
edges, |
|
|
Chunk & |
a, |
|
|
Chunk & |
b, |
|
|
bool |
transpose, |
|
|
bool |
opposite |
|
) |
| const |
|
private |
◆ FillRegionOnGrid()
◆ FindGoalRegionsAndBestNavcells()
◆ FindNearestNavcellInRegions()
◆ FindNearestPassableNavcell()
void HierarchicalPathfinder::FindNearestPassableNavcell |
( |
u16 & |
i, |
|
|
u16 & |
j, |
|
|
pass_class_t |
passClass |
|
) |
| const |
Updates i
, j
(which is assumed to be an impassable navcell) to the nearest passable navcell.
◆ FindReachableRegions()
template<typename Ordering >
void HierarchicalPathfinder::FindReachableRegions |
( |
RegionID |
from, |
|
|
std::set< RegionID, Ordering > & |
reachable, |
|
|
pass_class_t |
passClass |
|
) |
| const |
|
inlineprivate |
Returns all reachable regions, optionally ordered in a specific manner.
◆ Get()
◆ GetChunk()
◆ GetConnectivityGrid()
Generates the connectivity grid associated with the given pass_class.
◆ GetGlobalRegion() [1/2]
◆ GetGlobalRegion() [2/2]
◆ GetPassabilityClass()
pass_class_t HierarchicalPathfinder::GetPassabilityClass |
( |
const std::string & |
name | ) |
const |
|
inline |
◆ IsGoalReachable()
- Returns
- true if the goal is reachable from navcell i0, j0. (similar to MakeGoalReachable but only checking for reachability).
◆ MakeGoalReachable()
Updates goal
so that it's guaranteed to be reachable from the navcell i0
, j0
(which is assumed to be on a passable navcell).
If the goal is not reachable, it is replaced with a point goal nearest to the goal center.
In the case of a non-point reachable goal, it is replaced with a point goal at the reachable navcell of the goal which is nearest to the starting navcell.
- Returns
- true if the goal was reachable, false otherwise.
◆ Recompute()
void HierarchicalPathfinder::Recompute |
( |
Grid< NavcellData > * |
passabilityGrid, |
|
|
const std::map< std::string, pass_class_t > & |
nonPathfindingPassClassMasks, |
|
|
const std::map< std::string, pass_class_t > & |
pathfindingPassClassMasks |
|
) |
| |
◆ RecomputeAllEdges()
Find edges between regions in all chunks, in an optimised manner (only look at top/left)
◆ RenderSubmit()
void HierarchicalPathfinder::RenderSubmit |
( |
SceneCollector & |
collector | ) |
|
◆ SetDebugOverlay()
void HierarchicalPathfinder::SetDebugOverlay |
( |
bool |
enabled, |
|
|
const CSimContext * |
simContext |
|
) |
| |
◆ Update()
◆ UpdateEdges()
Connect a chunk's regions to their neighbors.
Not optimised for global recomputing.
◆ UpdateGlobalRegions()
void HierarchicalPathfinder::UpdateGlobalRegions |
( |
const std::map< pass_class_t, std::vector< RegionID > > & |
needNewGlobalRegionMap | ) |
|
|
private |
◆ CHUNK_SIZE
const u8 HierarchicalPathfinder::CHUNK_SIZE = 96 |
|
staticprivate |
◆ m_Chunks
◆ m_ChunksH
u8 HierarchicalPathfinder::m_ChunksH |
|
private |
◆ m_ChunksW
u8 HierarchicalPathfinder::m_ChunksW |
|
private |
◆ m_DebugOverlay
◆ m_DebugOverlayLines
std::vector<SOverlayLine> HierarchicalPathfinder::m_DebugOverlayLines |
◆ m_Edges
◆ m_GlobalRegions
◆ m_H
u16 HierarchicalPathfinder::m_H |
|
private |
◆ m_NextGlobalRegionID
◆ m_PassClassMasks
std::map<std::string, pass_class_t> HierarchicalPathfinder::m_PassClassMasks |
|
private |
◆ m_SimContext
const CSimContext* HierarchicalPathfinder::m_SimContext |
|
private |
◆ m_W
u16 HierarchicalPathfinder::m_W |
|
private |
The documentation for this class was generated from the following files: