Pyrogenesis  trunk
Classes | Namespaces | Macros | Typedefs | Functions | Variables
Pathfinding.h File Reference
#include "maths/MathUtil.h"
#include "ps/CLogger.h"
#include "simulation2/system/ParamNode.h"
#include "graphics/Terrain.h"
#include "Grid.h"
#include "PathGoal.h"
Include dependency graph for Pathfinding.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Waypoint
 
struct  WaypointPath
 Returned path. More...
 
struct  PathCost
 Represents the cost of a path consisting of horizontal/vertical and diagonal movements over a uniform-cost grid. More...
 
class  PathfinderPassability
 

Namespaces

 Pathfinding
 

Macros

#define IS_PASSABLE(item, classmask)   (((item) & (classmask)) == 0)
 
#define PASS_CLASS_MASK_FROM_INDEX(id)   ((pass_class_t)(1u << id))
 
#define SPECIAL_PASS_CLASS   PASS_CLASS_MASK_FROM_INDEX((PASS_CLASS_BITS-1))
 

Typedefs

typedef u16 pass_class_t
 
typedef u16 NavcellData
 

Functions

void Pathfinding::NearestNavcell (entity_pos_t x, entity_pos_t z, u16 &i, u16 &j, u16 w, u16 h)
 Compute the navcell indexes on the grid nearest to a given point w, h are the grid dimensions, i.e. More...
 
void Pathfinding::TileCenter (u16 i, u16 j, entity_pos_t &x, entity_pos_t &z)
 Returns the position of the center of the given tile. More...
 
void Pathfinding::NavcellCenter (u16 i, u16 j, entity_pos_t &x, entity_pos_t &z)
 
bool Pathfinding::CheckLineMovement (entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, pass_class_t passClass, const Grid< NavcellData > &grid)
 

Variables

static const int PASS_CLASS_BITS = 16
 
const int Pathfinding::NAVCELLS_PER_TILE = 4
 The long-range pathfinder operates primarily over a navigation grid (a uniform-cost 2D passability grid, with horizontal/vertical (not diagonal) connectivity). More...
 
const fixed Pathfinding::NAVCELL_SIZE = fixed::FromInt((int)TERRAIN_TILE_SIZE) / Pathfinding::NAVCELLS_PER_TILE
 Size of a navcell in metres ( = TERRAIN_TILE_SIZE / NAVCELLS_PER_TILE) More...
 
const int Pathfinding::NAVCELL_SIZE_INT = 1
 
const int Pathfinding::NAVCELL_SIZE_LOG2 = 0
 
const entity_pos_t Pathfinding::GOAL_DELTA = NAVCELL_SIZE/8
 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. More...
 
const entity_pos_t Pathfinding::CLEARANCE_EXTENSION_RADIUS = fixed::FromInt(1)
 To make sure the long-range pathfinder is more strict than the short-range one, we need to slightly over-rasterize. More...
 

Macro Definition Documentation

#define IS_PASSABLE (   item,
  classmask 
)    (((item) & (classmask)) == 0)
#define PASS_CLASS_MASK_FROM_INDEX (   id)    ((pass_class_t)(1u << id))
#define SPECIAL_PASS_CLASS   PASS_CLASS_MASK_FROM_INDEX((PASS_CLASS_BITS-1))

Typedef Documentation

typedef u16 NavcellData
typedef u16 pass_class_t

Variable Documentation

const int PASS_CLASS_BITS = 16
static