Runtime decoded-chunk cache for an EVTR terrain asset. 更多...
#include <TerrainStreaming.h>
Public 成员函数 | |
| bool | open (const uint8_t *data, size_t size, std::string *error=nullptr) |
| Compatibility operation that opens EVTR and clears decoded chunks. | |
| Result< void > | openSource (std::shared_ptr< const ITerrainArchiveSource > source) |
| Open EVTR through a retained random-access source without loading chunk payloads. | |
| void | clear () |
| TerrainStreamStats | streamAround (int worldX, int worldY, int radiusChunks, int maxLoads=0, std::string *error=nullptr) |
| Stream chunks around a world-space sample coordinate. | |
| const TerrainChunkData * | getChunk (int chunkX, int chunkY) const |
| Borrow a resident chunk. @lifetime Pointer remains valid until cache mutation. | |
| bool | sampleCell (int worldX, int worldY, TerrainSample &out) const |
| Compatibility operation that reads a resident integer world cell. | |
| bool | sampleHeight (float worldX, float worldY, float &out) const |
| Compatibility operation for cross-chunk bilinear height sampling. | |
| bool | getReceiver (int worldX, int worldY, int &receiverX, int &receiverY) const |
| Resolve a cell's D8 receiver in global coordinates, including an adjacent chunk. | |
| bool | traceFlow (int worldX, int worldY, int maxSteps, std::vector< std::pair< int, int > > &out) const |
| Compatibility operation that follows D8 receivers across chunks. | |
| bool | buildWindow (int originX, int originY, int width, int height, TerrainStreamingWindow &out) const |
| Compatibility operation that assembles a dense hydrology window. | |
| int | getResidentCount () const |
| Returns the resident count. | |
| const TerrainAsset & | asset () const |
| Asset. | |
详细描述
Runtime decoded-chunk cache for an EVTR terrain asset.
Requests are ordered nearest-first and may be limited per call with maxLoads, allowing a game to spread decompression across frames. Chunks outside the requested circular radius are evicted before new chunks load.
在文件 TerrainStreaming.h 第 51 行定义.
成员函数说明
◆ asset()
|
inline |
◆ buildWindow()
| bool eve::procgen::TerrainStreamingCache::buildWindow | ( | int | originX, |
| int | originY, | ||
| int | width, | ||
| int | height, | ||
| TerrainStreamingWindow & | out | ||
| ) | const |
Compatibility operation that assembles a dense hydrology window.
Requesting one extra cell on each side provides the halo needed for seam-stable river ribbons, normals, and bank calculations. Coordinates are global cells.
在文件 TerrainStreaming.cpp 第 139 行定义.
引用了 count, eve::procgen::TerrainAsset::getHeight(), eve::procgen::TerrainAsset::getWidth(), height, eve::procgen::raster_detail::sample(), sampleCell(), width, x , 以及 y.
◆ clear()
| void eve::procgen::TerrainStreamingCache::clear | ( | ) |
在文件 TerrainStreaming.cpp 第 32 行定义.
◆ getChunk()
| const TerrainChunkData * eve::procgen::TerrainStreamingCache::getChunk | ( | int | chunkX, |
| int | chunkY | ||
| ) | const |
Borrow a resident chunk. @lifetime Pointer remains valid until cache mutation.
在文件 TerrainStreaming.cpp 第 82 行定义.
引用了 key.
被这些函数引用 sampleCell() , 以及 streamAround().
◆ getReceiver()
| bool eve::procgen::TerrainStreamingCache::getReceiver | ( | int | worldX, |
| int | worldY, | ||
| int & | receiverX, | ||
| int & | receiverY | ||
| ) | const |
Resolve a cell's D8 receiver in global coordinates, including an adjacent chunk.
- 返回
- False for outlets, invalid directions, or when either required chunk is absent.
在文件 TerrainStreaming.cpp 第 105 行定义.
引用了 dx, dy, sampleCell() , 以及 source.
被这些函数引用 traceFlow().
◆ getResidentCount()
|
inline |
◆ open()
| bool eve::procgen::TerrainStreamingCache::open | ( | const uint8_t * | data, |
| size_t | size, | ||
| std::string * | error = nullptr |
||
| ) |
Compatibility operation that opens EVTR and clears decoded chunks.
在文件 TerrainStreaming.cpp 第 14 行定义.
◆ openSource()
| Result< void > eve::procgen::TerrainStreamingCache::openSource | ( | std::shared_ptr< const ITerrainArchiveSource > | source | ) |
Open EVTR through a retained random-access source without loading chunk payloads.
- 返回
- Success after metadata validation; failure preserves the previous cache.
在文件 TerrainStreaming.cpp 第 22 行定义.
引用了 source , 以及 eve::Result< T >::success().
◆ sampleCell()
| bool eve::procgen::TerrainStreamingCache::sampleCell | ( | int | worldX, |
| int | worldY, | ||
| TerrainSample & | out | ||
| ) | const |
Compatibility operation that reads a resident integer world cell.
在文件 TerrainStreaming.cpp 第 87 行定义.
引用了 eve::procgen::TerrainSample::biome, eve::procgen::TerrainChunkData::biomes, cx, cy, eve::procgen::Heightmap::data(), eve::procgen::TerrainChunkData::flowAccumulation, eve::procgen::TerrainSample::flowAccumulation, eve::procgen::TerrainChunkData::flowDirection, eve::procgen::TerrainSample::flowDirection, eve::procgen::TerrainChunkData::flowVectorX, eve::procgen::TerrainSample::flowVectorX, eve::procgen::TerrainChunkData::flowVectorY, eve::procgen::TerrainSample::flowVectorY, getChunk(), eve::procgen::TerrainAsset::getChunkSize(), eve::procgen::TerrainAsset::getHeight(), eve::procgen::TerrainAsset::getWidth(), eve::procgen::TerrainChunkData::height, eve::procgen::TerrainSample::height, eve::procgen::TerrainChunkData::heights, eve::procgen::TerrainSample::lake, eve::procgen::TerrainChunkData::lakeDepth, eve::procgen::TerrainSample::lakeDepth, eve::procgen::TerrainChunkData::moisture, eve::procgen::TerrainSample::moisture, eve::procgen::TerrainSample::river, eve::procgen::TerrainChunkData::rivers, eve::procgen::TerrainChunkData::streamOrder, eve::procgen::TerrainSample::streamOrder, eve::procgen::TerrainChunkData::temperature, eve::procgen::TerrainSample::temperature , 以及 eve::procgen::TerrainChunkData::width.
被这些函数引用 buildWindow(), getReceiver(), sampleHeight() , 以及 traceFlow().
◆ sampleHeight()
| bool eve::procgen::TerrainStreamingCache::sampleHeight | ( | float | worldX, |
| float | worldY, | ||
| float & | out | ||
| ) | const |
Compatibility operation for cross-chunk bilinear height sampling.
在文件 TerrainStreaming.cpp 第 176 行定义.
引用了 a, b, bottom, c, d, eve::procgen::TerrainAsset::getHeight(), eve::procgen::TerrainAsset::getWidth(), sampleCell() , 以及 top.
◆ streamAround()
| TerrainStreamStats eve::procgen::TerrainStreamingCache::streamAround | ( | int | worldX, |
| int | worldY, | ||
| int | radiusChunks, | ||
| int | maxLoads = 0, |
||
| std::string * | error = nullptr |
||
| ) |
Stream chunks around a world-space sample coordinate.
- 参数
-
radiusChunks Circular residency radius in chunks; negative is a no-op. maxLoads Maximum new chunks decoded this call; zero means unlimited.
在文件 TerrainStreaming.cpp 第 34 行定义.
引用了 a, b, cx, cy, dx, dy, error, eve::procgen::TerrainAsset::findChunk(), getChunk(), eve::procgen::TerrainAsset::getChunkSize(), getResidentCount(), key, eve::procgen::TerrainAsset::loadChunk(), radius, eve::procgen::TerrainStreamStats::resident, stats, x , 以及 y.
被这些函数引用 eve::voxel::VoxelWorld::streamAround(), eve::procgen::PcgTerrainStreamingAuthority::streamAround() , 以及 eve::voxel::VoxelWorld::streamTerrainAssetAround().
◆ traceFlow()
| bool eve::procgen::TerrainStreamingCache::traceFlow | ( | int | worldX, |
| int | worldY, | ||
| int | maxSteps, | ||
| std::vector< std::pair< int, int > > & | out | ||
| ) | const |
Compatibility operation that follows D8 receivers across chunks.
- 参数
-
maxSteps Safety limit; must be positive. out Global cell coordinates, including the starting cell.
- 返回
- False if tracing reaches a non-resident chunk or an invalid/cyclic receiver.
在文件 TerrainStreaming.cpp 第 118 行定义.
引用了 current, eve::procgen::TerrainSample::flowDirection, getReceiver(), sampleCell(), start , 以及 step.
该类的文档由以下文件生成:
- src/modules/procgen/heightmap/TerrainStreaming.h
- src/modules/procgen/heightmap/TerrainStreaming.cpp