Orchestrates infinite world generation, active chunk tracking, and multi-threaded data loading.
More...
#include <src/world/ChunkManager.h>
|
| | ChunkManager ()=delete |
| |
| | ChunkManager (std::string &strFolderPath) |
| |
| void | Update (float fPlayerX, float fPlayerZ) |
| | Core lifecycle loop. Synchronizes asynchronous chunks and manages the active render radius.
|
| |
| void | ReloadAllChunks () |
| |
| void | SetBlock (int iWorldX, int iWorldY, int iWorldZ, uint8_t iBlockType) |
| | Modifies a voxel block and invalidates necessary chunk meshes (including boundaries).
|
| |
| void | SaveWorld () |
| | Persists all active chunks to disk.
|
| |
| Chunk * | GetChunk (int iX, int iZ) |
| | Retrieves a pointer to a loaded chunk. Returns nullptr if not loaded.
|
| |
| const Chunk * | GetChunk (int iX, int iZ) const |
| |
| std::map< std::pair< int, int >, std::unique_ptr< Chunk > > & | GetMutableChunks () |
| |
| const std::map< std::pair< int, int >, std::unique_ptr< Chunk > > & | GetChunks () const |
| |
| void | SetActiveThreads (int iCt) |
| |
| int | GetActiveThreads () |
| |
| size_t | GetGeneratedVertCount () const |
| |
| size_t | GetGeneratedTriaCount () const |
| |
| void | AddToUploadedVertCount (size_t iCt) |
| |
| void | ResetUploadedVertCount () |
| |
| size_t | GetUploadedVertCount () const |
| |
| void | AddToUploadedTriaCount (size_t iCt) |
| |
| void | ResetUploadedTriaCount () |
| |
| size_t | GetUploadedTriaCount () const |
| |
| void | SetNeighborCulling (bool bNeighborCulling) |
| |
| bool | GetNeighborCulling () const |
| |
Orchestrates infinite world generation, active chunk tracking, and multi-threaded data loading.
◆ ChunkManager() [1/2]
| ChunkManager::ChunkManager |
( |
| ) |
|
|
delete |
◆ ChunkManager() [2/2]
| ChunkManager::ChunkManager |
( |
std::string & |
strFolderPath | ) |
|
|
inline |
◆ AddToUploadedTriaCount()
| void ChunkManager::AddToUploadedTriaCount |
( |
size_t |
iCt | ) |
|
|
inline |
◆ AddToUploadedVertCount()
| void ChunkManager::AddToUploadedVertCount |
( |
size_t |
iCt | ) |
|
|
inline |
◆ enqueueLoadChunk()
| void ChunkManager::enqueueLoadChunk |
( |
int |
iX, |
|
|
int |
iZ |
|
) |
| |
|
private |
◆ GetActiveThreads()
| int ChunkManager::GetActiveThreads |
( |
| ) |
|
|
inline |
◆ GetChunk() [1/2]
| Chunk * ChunkManager::GetChunk |
( |
int |
iX, |
|
|
int |
iZ |
|
) |
| |
Retrieves a pointer to a loaded chunk. Returns nullptr if not loaded.
◆ GetChunk() [2/2]
| const Chunk * ChunkManager::GetChunk |
( |
int |
iX, |
|
|
int |
iZ |
|
) |
| const |
◆ GetChunks()
| const std::map< std::pair< int, int >, std::unique_ptr< Chunk > > & ChunkManager::GetChunks |
( |
| ) |
const |
|
inline |
◆ GetGeneratedTriaCount()
| size_t ChunkManager::GetGeneratedTriaCount |
( |
| ) |
const |
|
inline |
◆ GetGeneratedVertCount()
| size_t ChunkManager::GetGeneratedVertCount |
( |
| ) |
const |
|
inline |
◆ GetMutableChunks()
| std::map< std::pair< int, int >, std::unique_ptr< Chunk > > & ChunkManager::GetMutableChunks |
( |
| ) |
|
|
inline |
◆ GetNeighborCulling()
| bool ChunkManager::GetNeighborCulling |
( |
| ) |
const |
|
inline |
◆ GetUploadedTriaCount()
| size_t ChunkManager::GetUploadedTriaCount |
( |
| ) |
const |
|
inline |
◆ GetUploadedVertCount()
| size_t ChunkManager::GetUploadedVertCount |
( |
| ) |
const |
|
inline |
◆ ReloadAllChunks()
| void ChunkManager::ReloadAllChunks |
( |
| ) |
|
◆ ResetUploadedTriaCount()
| void ChunkManager::ResetUploadedTriaCount |
( |
| ) |
|
|
inline |
◆ ResetUploadedVertCount()
| void ChunkManager::ResetUploadedVertCount |
( |
| ) |
|
|
inline |
◆ SaveWorld()
| void ChunkManager::SaveWorld |
( |
| ) |
|
Persists all active chunks to disk.
◆ SetActiveThreads()
| void ChunkManager::SetActiveThreads |
( |
int |
iCt | ) |
|
|
inline |
◆ SetBlock()
| void ChunkManager::SetBlock |
( |
int |
iWorldX, |
|
|
int |
iWorldY, |
|
|
int |
iWorldZ, |
|
|
uint8_t |
iBlockType |
|
) |
| |
Modifies a voxel block and invalidates necessary chunk meshes (including boundaries).
◆ SetNeighborCulling()
| void ChunkManager::SetNeighborCulling |
( |
bool |
bNeighborCulling | ) |
|
|
inline |
◆ Update()
| void ChunkManager::Update |
( |
float |
fPlayerX, |
|
|
float |
fPlayerZ |
|
) |
| |
Core lifecycle loop. Synchronizes asynchronous chunks and manages the active render radius.
- Parameters
-
◆ updateChunkNeighbours()
| void ChunkManager::updateChunkNeighbours |
( |
Chunk * |
pChunk | ) |
|
|
private |
◆ updateGeneratedMeshStats()
| void ChunkManager::updateGeneratedMeshStats |
( |
| ) |
|
|
private |
◆ m_bEnableNeighborCulling
| bool ChunkManager::m_bEnableNeighborCulling = true |
|
private |
◆ m_iActiveThreads
| int ChunkManager::m_iActiveThreads = 4 |
|
private |
◆ m_iGeneratedTriangleCount
| size_t ChunkManager::m_iGeneratedTriangleCount = 0 |
|
private |
◆ m_iGeneratedVertexCount
| size_t ChunkManager::m_iGeneratedVertexCount = 0 |
|
private |
◆ m_iLastPlayerChunkX
| int ChunkManager::m_iLastPlayerChunkX = -999999 |
|
private |
◆ m_iLastPlayerChunkZ
| int ChunkManager::m_iLastPlayerChunkZ = -999999 |
|
private |
◆ m_iRenderDistance
| int ChunkManager::m_iRenderDistance = 6 |
|
private |
◆ m_iUploadedTriangleCount
| size_t ChunkManager::m_iUploadedTriangleCount = 0 |
|
private |
◆ m_iUploadedVertexCount
| size_t ChunkManager::m_iUploadedVertexCount = 0 |
|
private |
◆ m_mapChunks
| std::map<std::pair<int, int>, std::unique_ptr<Chunk> > ChunkManager::m_mapChunks |
|
private |
◆ m_mutexPending
| std::mutex ChunkManager::m_mutexPending |
|
private |
◆ m_objFinishedQueue
◆ m_objRegionManager
◆ m_objThreadPool
◆ m_setPendingCoords
| std::set<std::pair<int, int> > ChunkManager::m_setPendingCoords |
|
private |
The documentation for this class was generated from the following files: