21 cVoronoiMap(
int a_Seed,
int a_CellSize = 128,
int a_JitterSize = 128);
39 int GetValueAt(
int a_X,
int a_Y,
int & a_MinDistance);
45 int & a_NearestSeedX,
int & a_NearestSeedY,
52 int & a_NearestSeedX,
int & a_NearestSeedY,
53 int & a_SecondNearestSeedX,
int & a_SecondNearestSeedY
int m_CurrentCellZ
The Z coordinate of the currently cached cell neighborhood.
int m_SeedX[5][5]
The seeds of cells around m_CurrentCellX, m_CurrentCellZ, X-coords.
void SetCellSize(int a_CellSize)
Sets both the cell size and jitter size used for generating the Voronoi seeds.
int m_CellSize
Size of the Voronoi cells (avg X / Y distance between the seeds).
int m_JitterSize
The amount that the cell seeds may be offset from the grid.
void FindNearestSeeds(int a_X, int a_Y, int &a_NearestSeedX, int &a_NearestSeedY, int &a_SecondNearestSeedX, int &a_SecondNearestSeedY)
Finds the nearest and second nearest seeds, returns their coords.
cVoronoiMap(int a_Seed, int a_CellSize=128, int a_JitterSize=128)
void SetJitterSize(int a_JitterSize)
Sets the jitter size.
int m_CurrentCellX
The X coordinate of the currently cached cell neighborhood.
int m_SeedZ[5][5]
The seeds of cells around m_CurrentCellX, m_CurrentCellZ, X-coords.
void UpdateCell(int a_CellX, int a_CellZ)
Updates the cached cell seeds to match the specified cell.
void SetOddRowOffset(int a_OddRowOffset)
Sets the offset that is added to each odd row of cells.
int m_OddRowOffset
The constant amount that the cell seeds of every odd row will be offset from the grid.
cNoise m_Noise1
The noise used for generating Voronoi seeds.
int GetValueAt(int a_X, int a_Y)
Returns the value in the cell into which the specified point lies.