Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CCmpPathfinder.cpp File Reference

Common code and setup code for CCmpPathfinder. More...

Include dependency graph for CCmpPathfinder.cpp:

Classes

struct  SerializeHelper< LongPathRequest >
 
struct  SerializeHelper< ShortPathRequest >
 

Functions

static void ExpandImpassableCells (Grid< NavcellData > &grid, u16 clearance, pass_class_t mask)
 Given a grid of passable/impassable navcells (based on some passability mask), computes a new grid where a navcell is impassable (per that mask) if it is <=clearance navcells away from an impassable navcell in the original grid. More...
 

Detailed Description

Common code and setup code for CCmpPathfinder.

Function Documentation

◆ ExpandImpassableCells()

static void ExpandImpassableCells ( Grid< NavcellData > &  grid,
u16  clearance,
pass_class_t  mask 
)
static

Given a grid of passable/impassable navcells (based on some passability mask), computes a new grid where a navcell is impassable (per that mask) if it is <=clearance navcells away from an impassable navcell in the original grid.

The results are ORed onto the original grid.

This is used for adding clearance onto terrain-based navcell passability.

TODO PATHFINDER: might be nicer to get rounded corners by measuring clearances as Euclidean distances; currently it effectively does dist=max(dx,dy) instead. This would only really be a problem for big clearances.