Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/helpers/Pathfinding.h
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | namespace Pathfinding | ||||
/** | /** | ||||
* Size of a navcell in metres ( = TERRAIN_TILE_SIZE / NAVCELLS_PER_TILE) | * Size of a navcell in metres ( = TERRAIN_TILE_SIZE / NAVCELLS_PER_TILE) | ||||
*/ | */ | ||||
const fixed NAVCELL_SIZE = fixed::FromInt((int)TERRAIN_TILE_SIZE) / Pathfinding::NAVCELLS_PER_TILE; | const fixed NAVCELL_SIZE = fixed::FromInt((int)TERRAIN_TILE_SIZE) / Pathfinding::NAVCELLS_PER_TILE; | ||||
const int NAVCELL_SIZE_INT = 1; | const int NAVCELL_SIZE_INT = 1; | ||||
const int NAVCELL_SIZE_LOG2 = 0; | const int NAVCELL_SIZE_LOG2 = 0; | ||||
/** | /** | ||||
* For extending the goal outwards/inwards a little bit | |||||
* NOTE: keep next to the definition of NAVCELL_SIZE to avoid init order problems | |||||
* between translation units. | |||||
* TODO: figure out whether this is actually needed. It was added back in r8751 (in 2010) for unclear reasons | |||||
* and it does not seem to really improve behavior today | |||||
*/ | |||||
const entity_pos_t GOAL_DELTA = NAVCELL_SIZE/8; | |||||
/** | |||||
* To make sure the long-range pathfinder is more strict than the short-range one, | * To make sure the long-range pathfinder is more strict than the short-range one, | ||||
* we need to slightly over-rasterize. So we extend the clearance radius by 1. | * we need to slightly over-rasterize. So we extend the clearance radius by 1. | ||||
*/ | */ | ||||
const entity_pos_t CLEARANCE_EXTENSION_RADIUS = fixed::FromInt(1); | const entity_pos_t CLEARANCE_EXTENSION_RADIUS = fixed::FromInt(1); | ||||
/** | /** | ||||
* Compute the navcell indexes on the grid nearest to a given point | * Compute the navcell indexes on the grid nearest to a given point | ||||
* w, h are the grid dimensions, i.e. the number of navcells per side | * w, h are the grid dimensions, i.e. the number of navcells per side | ||||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator