ezEngine  Milestone 7
ezGridNavmesh Class Reference

Takes an ezGameGrid and creates an optimized navmesh structure from it, that is more efficient for path searches. More...

#include <GridNavmesh.h>

Classes

struct  AreaEdge
 
struct  ConvexArea
 

Public Types

typedef bool(* CellComparator )(ezUInt32 uiCell1, ezUInt32 uiCell2, void *pPassThrough)
 Callback that determines whether the cell with index uiCell1 and the cell with index uiCell2 represent the same type of terrain.
 
typedef bool(* CellBlocked )(ezUInt32 uiCell, void *pPassThrough)
 Callback that determines whether the cell with index uiCell is blocked entirely (for every type of unit) and therefore can be optimized away.
 

Public Member Functions

template<class CellData >
void CreateFromGrid (const ezGameGrid< CellData > &Grid, CellComparator IsSameCellType, void *pPassThroughSame, CellBlocked IsCellBlocked, void *pPassThroughBlocked)
 Creates the navmesh from the given ezGameGrid.
 
ezInt32 GetAreaAt (const ezVec2I32 &Coord) const
 Returns the index of the ConvexArea at the given cell coordinates. Negative, if the cell is blocked.
 
ezUInt32 GetNumConvexAreas () const
 Returns the number of convex areas that this navmesh consists of.
 
const ConvexAreaGetConvexArea (ezInt32 iArea) const
 Returns the given convex area by index.
 
ezUInt32 GetNumAreaEdges () const
 Returns the number of edges between convex areas.
 
const AreaEdgeGetAreaEdge (ezInt32 iAreaEdge) const
 Returns the given area edge by index.
 

Private Member Functions

void UpdateRegion (ezRectU32 region, CellComparator IsSameCellType, void *pPassThrough1, CellBlocked IsCellBlocked, void *pPassThrough2)
 
void Optimize (ezRectU32 region, CellComparator IsSameCellType, void *pPassThrough)
 
bool OptimizeBoxes (ezRectU32 region, CellComparator IsSameCellType, void *pPassThrough, ezUInt32 uiIntervalX, ezUInt32 uiIntervalY, ezUInt32 uiWidth, ezUInt32 uiHeight, ezUInt32 uiOffsetX=0, ezUInt32 uiOffsetY=0)
 
bool CanCreateArea (ezRectU32 region, CellComparator IsSameCellType, void *pPassThrough) const
 
bool CanMergeRight (ezInt32 x, ezInt32 y, CellComparator IsSameCellType, void *pPassThrough, ezRectU32 &out_Result) const
 
bool CanMergeDown (ezInt32 x, ezInt32 y, CellComparator IsSameCellType, void *pPassThrough, ezRectU32 &out_Result) const
 
bool MergeBestFit (ezRectU32 region, CellComparator IsSameCellType, void *pPassThrough)
 
void CreateGraphEdges ()
 
void CreateGraphEdges (ConvexArea &Area)
 
ezRectU32 GetCellBBox (ezInt32 x, ezInt32 y) const
 
void Merge (const ezRectU32 &rect)
 
void CreateNodes (ezRectU32 region, CellBlocked IsCellBlocked, void *pPassThrough)
 

Private Attributes

ezGameGrid< ezInt32 > m_NodesGrid
 
ezDynamicArray< ConvexAream_ConvexAreas
 
ezDeque< AreaEdgem_GraphEdges
 

Detailed Description

Takes an ezGameGrid and creates an optimized navmesh structure from it, that is more efficient for path searches.


The documentation for this class was generated from the following files: