Pyrogenesis  trunk
Public Member Functions | Public Attributes | List of all members
HierarchicalPathfinder::Chunk Struct Reference

Public Member Functions

 cassert (CHUNK_SIZE *CHUNK_SIZE/2< 65536)
 
void InitRegions (int ci, int cj, Grid< NavcellData > *grid, pass_class_t passClass)
 
RegionID Get (int i, int j) const
 Returns a RegionID for the given global navcell coords (which must be inside this chunk);. More...
 
void RegionCenter (u16 r, int &i, int &j) const
 Return the global navcell coords that correspond roughly to the center of the given region in this chunk. More...
 
void RegionNavcellNearest (u16 r, int iGoal, int jGoal, int &iBest, int &jBest, u32 &dist2Best) const
 Returns the global navcell coords, and the squared distance to the goal navcell, of whichever navcell inside the given region is closest to that goal. More...
 
bool RegionNearestNavcellInGoal (u16 r, u16 i0, u16 j0, const PathGoal &goal, u16 &iOut, u16 &jOut, u32 &dist2Best) const
 Gives the global navcell coords, and the squared distance to the (i0,j0) navcell, of whichever navcell inside the given region and inside the given goal is closest to (i0,j0) Returns true if the goal is inside the region, false otherwise. More...
 

Public Attributes

u8 m_ChunkI
 
u8 m_ChunkJ
 
u16 m_NumRegions
 
u16 m_Regions [CHUNK_SIZE][CHUNK_SIZE]
 

Member Function Documentation

HierarchicalPathfinder::Chunk::cassert ( )
HierarchicalPathfinder::RegionID HierarchicalPathfinder::Chunk::Get ( int  i,
int  j 
) const

Returns a RegionID for the given global navcell coords (which must be inside this chunk);.

void HierarchicalPathfinder::Chunk::InitRegions ( int  ci,
int  cj,
Grid< NavcellData > *  grid,
pass_class_t  passClass 
)
void HierarchicalPathfinder::Chunk::RegionCenter ( u16  r,
int &  i_out,
int &  j_out 
) const

Return the global navcell coords that correspond roughly to the center of the given region in this chunk.

(This is not guaranteed to be actually inside the region.)

void HierarchicalPathfinder::Chunk::RegionNavcellNearest ( u16  r,
int  iGoal,
int  jGoal,
int &  iBest,
int &  jBest,
u32 dist2Best 
) const

Returns the global navcell coords, and the squared distance to the goal navcell, of whichever navcell inside the given region is closest to that goal.

bool HierarchicalPathfinder::Chunk::RegionNearestNavcellInGoal ( u16  r,
u16  i0,
u16  j0,
const PathGoal goal,
u16 iOut,
u16 jOut,
u32 dist2Best 
) const

Gives the global navcell coords, and the squared distance to the (i0,j0) navcell, of whichever navcell inside the given region and inside the given goal is closest to (i0,j0) Returns true if the goal is inside the region, false otherwise.

Member Data Documentation

u8 HierarchicalPathfinder::Chunk::m_ChunkI
u8 HierarchicalPathfinder::Chunk::m_ChunkJ
u16 HierarchicalPathfinder::Chunk::m_NumRegions
u16 HierarchicalPathfinder::Chunk::m_Regions[CHUNK_SIZE][CHUNK_SIZE]

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