Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Functions | Variables
CCmpPathfinder_Tile.cpp File Reference

Tile-based algorithm for CCmpPathfinder. More...

#include "precompiled.h"
#include "CCmpPathfinder_Common.h"
#include "ps/Profile.h"
#include "renderer/TerrainOverlay.h"
#include "simulation2/helpers/PriorityQueue.h"

Go to the source code of this file.

Classes

struct  PathfindTile
 Tile data for A* computation. More...
 
class  PathfinderOverlay
 Terrain overlay for pathfinder debugging. More...
 
struct  PathfinderState
 

Macros

#define PATHFIND_STATS   0
 
#define USE_DIAGONAL_MOVEMENT   1
 

Typedefs

typedef PriorityQueueHeap
< std::pair< u16, u16 >, u32
PriorityQueue
 

Functions

static bool AtGoal (u16 i, u16 j, const ICmpPathfinder::Goal &goal)
 
static u32 CalculateHeuristic (u16 i, u16 j, u16 iGoal, u16 jGoal, u16 rGoal)
 
static u32 CalculateCostDelta (u16 pi, u16 pj, u16 i, u16 j, PathfindTileGrid *tempGrid, u32 tileCost)
 
static void ProcessNeighbour (u16 pi, u16 pj, u16 i, u16 j, u32 pg, PathfinderState &state)
 

Variables

const u32 g_CostPerTile = 256
 

Detailed Description

Tile-based algorithm for CCmpPathfinder.

This is a fairly naive algorithm and could probably be improved substantially (hopefully without needing to change the interface much).

Definition in file CCmpPathfinder_Tile.cpp.

Macro Definition Documentation

#define PATHFIND_STATS   0

Definition at line 35 of file CCmpPathfinder_Tile.cpp.

#define USE_DIAGONAL_MOVEMENT   1

Definition at line 37 of file CCmpPathfinder_Tile.cpp.

Typedef Documentation

typedef PriorityQueueHeap<std::pair<u16, u16>, u32> PriorityQueue

Definition at line 33 of file CCmpPathfinder_Tile.cpp.

Function Documentation

static bool AtGoal ( u16  i,
u16  j,
const ICmpPathfinder::Goal goal 
)
static

Definition at line 218 of file CCmpPathfinder_Tile.cpp.

static u32 CalculateCostDelta ( u16  pi,
u16  pj,
u16  i,
u16  j,
PathfindTileGrid tempGrid,
u32  tileCost 
)
static

Definition at line 258 of file CCmpPathfinder_Tile.cpp.

static u32 CalculateHeuristic ( u16  i,
u16  j,
u16  iGoal,
u16  jGoal,
u16  rGoal 
)
static

Definition at line 232 of file CCmpPathfinder_Tile.cpp.

static void ProcessNeighbour ( u16  pi,
u16  pj,
u16  i,
u16  j,
u32  pg,
PathfinderState state 
)
static

Definition at line 291 of file CCmpPathfinder_Tile.cpp.

Variable Documentation

const u32 g_CostPerTile = 256

Definition at line 41 of file CCmpPathfinder_Tile.cpp.