Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
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 (std::uint16_t 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 (std::uint16_t r, int iGoal, int jGoal, int &iBest, int &jBest, std::uint32_t &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 (std::uint16_t r, std::uint16_t i0, std::uint16_t j0, const PathGoal &goal, std::uint16_t &iOut, std::uint16_t &jOut, std::uint32_t &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

std::uint8_t m_ChunkI
 
std::uint8_t m_ChunkJ
 
std::vector< std::uint16_t > m_RegionsID
 
std::uint16_t m_Regions [CHUNK_SIZE][CHUNK_SIZE]
 

Member Function Documentation

◆ cassert()

HierarchicalPathfinder::Chunk::cassert ( )

◆ Get()

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);.

◆ InitRegions()

void HierarchicalPathfinder::Chunk::InitRegions ( int  ci,
int  cj,
Grid< NavcellData > *  grid,
pass_class_t  passClass 
)

◆ RegionCenter()

void HierarchicalPathfinder::Chunk::RegionCenter ( std::uint16_t  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.)

◆ RegionNavcellNearest()

void HierarchicalPathfinder::Chunk::RegionNavcellNearest ( std::uint16_t  r,
int  iGoal,
int  jGoal,
int &  iBest,
int &  jBest,
std::uint32_t &  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.

◆ RegionNearestNavcellInGoal()

bool HierarchicalPathfinder::Chunk::RegionNearestNavcellInGoal ( std::uint16_t  r,
std::uint16_t  i0,
std::uint16_t  j0,
const PathGoal &  goal,
std::uint16_t &  iOut,
std::uint16_t &  jOut,
std::uint32_t &  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

◆ m_ChunkI

std::uint8_t HierarchicalPathfinder::Chunk::m_ChunkI

◆ m_ChunkJ

std::uint8_t HierarchicalPathfinder::Chunk::m_ChunkJ

◆ m_Regions

std::uint16_t HierarchicalPathfinder::Chunk::m_Regions[CHUNK_SIZE][CHUNK_SIZE]

◆ m_RegionsID

std::vector<std::uint16_t> HierarchicalPathfinder::Chunk::m_RegionsID

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