Manages voxel block data, procedural mesh generation, and memory-aligned thermal diffusion buffers.
More...
#include <src/world/Chunk.h>
|
| | Chunk ()=delete |
| |
| | Chunk (int iX, int iZ) |
| |
| | ~Chunk () |
| |
| | Chunk (const Chunk &)=delete |
| |
| Chunk & | operator= (const Chunk &)=delete |
| |
| | Chunk (Chunk &&other) noexcept |
| |
| Chunk & | operator= (Chunk &&other) noexcept |
| |
| int | GetChunkX () const |
| |
| int | GetChunkZ () const |
| |
| bool | IsValid () const |
| |
| const uint8_t * | GetBlockData () const |
| |
| AABB | GetAABB () const |
| | Generates the AABB for the entire chunk based on max height.
|
| |
| void | Render () const |
| |
| void | SetNeighbours (Direction iDir, Chunk *pChunk) |
| |
| int | GetFlatIndexOf3DLayer (int iX, int iY, int iZ) const |
| |
| int | GetPaddedIndexOf3DLayer (int iX, int iY, int iZ) const |
| |
| __m256i | GetFlatIndexOf3DLayer_AVX2 (__m256i vecX, __m256i vecY, __m256i vecZ) const |
| |
| uint8_t | GetBlockAt (int iX, int iY, int iZ) const |
| | Gets a block ID. Handles boundary checks by querying neighbors.
|
| |
| void | SetBlockAt (int iX, int iY, int iZ, uint8_t uiBlockType) |
| |
| void | SetBlockData (const uint8_t *iBlocks) |
| |
| float | GetTemperatureAt (int iX, int iY, int iZ) const |
| |
| void | ReconstructMesh (bool bEnableNeighborCulling=false) |
| |
| void | UploadMesh () |
| |
| void | SwapBuffers () |
| |
| void | InjectHeat (int iX, int iY, int iZ, float fTemp) |
| |
| void | ThermalStep (float fThermalDiffusivity, float fDeltaTime) |
| |
| void | ThermalStep_AVX2 (float fThermalDiffusivity, float fDeltaTime) |
| |
| float * | GetCurrData () const |
| |
| void | UpdateThermalTexture () |
| |
| void | Bind (int iVal) |
| |
| void | GetMeshStats (size_t &uiOutVertCount, size_t &uiOutTriCount) const |
| |
Manages voxel block data, procedural mesh generation, and memory-aligned thermal diffusion buffers.
◆ Chunk() [1/4]
◆ Chunk() [2/4]
| Chunk::Chunk |
( |
int |
iX, |
|
|
int |
iZ |
|
) |
| |
◆ ~Chunk()
◆ Chunk() [3/4]
| Chunk::Chunk |
( |
const Chunk & |
| ) |
|
|
delete |
◆ Chunk() [4/4]
| Chunk::Chunk |
( |
Chunk && |
other | ) |
|
|
noexcept |
◆ addBlockFace()
| void Chunk::addBlockFace |
( |
int |
iX, |
|
|
int |
iY, |
|
|
int |
iZ, |
|
|
FaceDirection |
iDir, |
|
|
int |
iBlockType |
|
) |
| |
|
private |
◆ Bind()
| void Chunk::Bind |
( |
int |
iVal | ) |
|
|
inline |
◆ GetAABB()
| AABB Chunk::GetAABB |
( |
| ) |
const |
Generates the AABB for the entire chunk based on max height.
◆ GetBlockAt()
| uint8_t Chunk::GetBlockAt |
( |
int |
iX, |
|
|
int |
iY, |
|
|
int |
iZ |
|
) |
| const |
|
inline |
Gets a block ID. Handles boundary checks by querying neighbors.
◆ GetBlockData()
| const uint8_t * Chunk::GetBlockData |
( |
| ) |
const |
|
inline |
◆ GetChunkX()
| int Chunk::GetChunkX |
( |
| ) |
const |
|
inline |
◆ GetChunkZ()
| int Chunk::GetChunkZ |
( |
| ) |
const |
|
inline |
◆ GetCurrData()
| float * Chunk::GetCurrData |
( |
| ) |
const |
|
inline |
◆ GetFlatIndexOf3DLayer()
| int Chunk::GetFlatIndexOf3DLayer |
( |
int |
iX, |
|
|
int |
iY, |
|
|
int |
iZ |
|
) |
| const |
|
inline |
◆ GetFlatIndexOf3DLayer_AVX2()
| __m256i Chunk::GetFlatIndexOf3DLayer_AVX2 |
( |
__m256i |
vecX, |
|
|
__m256i |
vecY, |
|
|
__m256i |
vecZ |
|
) |
| const |
|
inline |
◆ GetMeshStats()
| void Chunk::GetMeshStats |
( |
size_t & |
uiOutVertCount, |
|
|
size_t & |
uiOutTriCount |
|
) |
| const |
|
inline |
◆ GetPaddedIndexOf3DLayer()
| int Chunk::GetPaddedIndexOf3DLayer |
( |
int |
iX, |
|
|
int |
iY, |
|
|
int |
iZ |
|
) |
| const |
|
inline |
◆ GetTemperatureAt()
| float Chunk::GetTemperatureAt |
( |
int |
iX, |
|
|
int |
iY, |
|
|
int |
iZ |
|
) |
| const |
◆ InjectHeat()
| void Chunk::InjectHeat |
( |
int |
iX, |
|
|
int |
iY, |
|
|
int |
iZ, |
|
|
float |
fTemp |
|
) |
| |
|
inline |
◆ IsValid()
| bool Chunk::IsValid |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ ReconstructMesh()
| void Chunk::ReconstructMesh |
( |
bool |
bEnableNeighborCulling = false | ) |
|
◆ Render()
| void Chunk::Render |
( |
| ) |
const |
◆ SetBlockAt()
| void Chunk::SetBlockAt |
( |
int |
iX, |
|
|
int |
iY, |
|
|
int |
iZ, |
|
|
uint8_t |
uiBlockType |
|
) |
| |
◆ SetBlockData()
| void Chunk::SetBlockData |
( |
const uint8_t * |
iBlocks | ) |
|
|
inline |
◆ SetNeighbours()
◆ SwapBuffers()
| void Chunk::SwapBuffers |
( |
| ) |
|
|
inline |
◆ ThermalStep()
| void Chunk::ThermalStep |
( |
float |
fThermalDiffusivity, |
|
|
float |
fDeltaTime |
|
) |
| |
◆ ThermalStep_AVX2()
| void Chunk::ThermalStep_AVX2 |
( |
float |
fThermalDiffusivity, |
|
|
float |
fDeltaTime |
|
) |
| |
◆ updateBuffers()
| void Chunk::updateBuffers |
( |
| ) |
|
|
private |
◆ updateHeightData()
| void Chunk::updateHeightData |
( |
| ) |
|
|
private |
◆ UpdateThermalTexture()
| void Chunk::UpdateThermalTexture |
( |
| ) |
|
◆ UploadMesh()
| void Chunk::UploadMesh |
( |
| ) |
|
◆ m_bVonNeumannBC
| bool Chunk::m_bVonNeumannBC = true |
|
private |
◆ m_iBlocks
◆ m_iChunkX
◆ m_iChunkZ
◆ m_iHeightData
◆ m_pfCurrFrameData
| float* Chunk::m_pfCurrFrameData = nullptr |
|
private |
◆ m_pfNextFrameData
| float* Chunk::m_pfNextFrameData = nullptr |
|
private |
◆ m_pIBO
◆ m_pNeighbours
| Chunk* Chunk::m_pNeighbours[6] = {nullptr} |
|
private |
◆ m_pThermalTex
◆ m_pVAO
◆ m_pVBO
◆ m_uiTriangleCount
| size_t Chunk::m_uiTriangleCount = 0 |
|
private |
◆ m_uiVertexCount
| size_t Chunk::m_uiVertexCount = 0 |
|
private |
◆ m_vec_fVertices
| std::vector<float> Chunk::m_vec_fVertices |
|
private |
◆ m_vec_uiIndices
| std::vector<unsigned int> Chunk::m_vec_uiIndices |
|
private |
◆ noise
| FastNoiseLite Chunk::noise {} |
|
private |
The documentation for this class was generated from the following files: