Versioned, random-access terrain archive. 更多...
#include <TerrainAsset.h>
Public 成员函数 | |
| bool | open (const uint8_t *data, size_t size, std::string *error=nullptr) |
| Compatibility operation that opens only the header and directory. | |
| Result< void > | openSource (std::shared_ptr< const ITerrainArchiveSource > source) |
| Open only EVTR metadata from a shared immutable random-access source. | |
| bool | loadChunk (int chunkX, int chunkY, TerrainChunkData &out, std::string *error=nullptr) const |
| Compatibility operation that loads and verifies one chunk. | |
| int | getWidth () const |
| Returns the width. | |
| int | getHeight () const |
| Returns the height. | |
| int | getChunkSize () const |
| Returns the chunk size. | |
| float | getMinHeight () const |
| Returns the min height. | |
| float | getMaxHeight () const |
| Returns the max height. | |
| const std::vector< TerrainChunkEntry > & | chunks () const |
| Chunks. | |
| const TerrainChunkEntry * | findChunk (int chunkX, int chunkY) const noexcept |
| Find one chunk directory entry without scanning the full directory. | |
静态 Public 成员函数 | |
| static bool | bake (const Heightmap &heightmap, const HydrologyMap &hydrology, const ClimateMap &climate, int chunkSize, std::vector< uint8_t > &out, std::string *error=nullptr) |
| Compatibility operation that bakes all terrain layers into EVTR. | |
详细描述
Versioned, random-access terrain archive.
EVTR stores a fixed header and deterministic chunk directory followed by independently PackBits-compressed payloads. Heights use archive-wide UNORM16; temperature, moisture, normalized drainage and normalized lake depth use UNORM8. Continuous flow vectors use two signed-normalized bytes; flow direction, river and biome layers remain exact bytes. A corrupt chunk cannot silently enter the world.
在文件 TerrainAsset.h 第 81 行定义.
成员函数说明
◆ bake()
|
static |
Compatibility operation that bakes all terrain layers into EVTR.
在文件 TerrainAsset.cpp 第 96 行定义.
引用了 bytes, cells, climate, cursor, cx, cy, eve::procgen::Heightmap::data(), direction, error, eve::procgen::HydrologyMap::flowAccumulation, eve::procgen::HydrologyMap::flowDirection, eve::procgen::HydrologyMap::flowVectorX, eve::procgen::HydrologyMap::flowVectorY, eve::procgen::Heightmap::getHeight(), eve::procgen::Heightmap::getWidth(), h, eve::procgen::HydrologyMap::height, eve::procgen::HydrologyMap::lakeDepth, eve::procgen::HydrologyMap::rivers, eve::procgen::HydrologyMap::streamOrder, w , 以及 eve::procgen::HydrologyMap::width.
◆ chunks()
|
inline |
Chunks.
在文件 TerrainAsset.h 第 112 行定义.
◆ findChunk()
|
noexcept |
Find one chunk directory entry without scanning the full directory.
在文件 TerrainAsset.cpp 第 333 行定义.
引用了 eve::procgen::TerrainChunkEntry::chunkX, eve::procgen::TerrainChunkEntry::chunkY, columns , 以及 index.
被这些函数引用 loadChunk() , 以及 eve::procgen::TerrainStreamingCache::streamAround().
◆ getChunkSize()
|
inline |
Returns the chunk size.
在文件 TerrainAsset.h 第 106 行定义.
被这些函数引用 eve::procgen::TerrainStreamingCache::sampleCell(), eve::voxel::VoxelWorld::streamAround() , 以及 eve::procgen::TerrainStreamingCache::streamAround().
◆ getHeight()
|
inline |
Returns the height.
在文件 TerrainAsset.h 第 104 行定义.
被这些函数引用 eve::procgen::TerrainStreamingCache::buildWindow(), eve::procgen::TerrainStreamingCache::sampleCell() , 以及 eve::procgen::TerrainStreamingCache::sampleHeight().
◆ getMaxHeight()
|
inline |
Returns the max height.
在文件 TerrainAsset.h 第 110 行定义.
◆ getMinHeight()
|
inline |
Returns the min height.
在文件 TerrainAsset.h 第 108 行定义.
◆ getWidth()
|
inline |
Returns the width.
在文件 TerrainAsset.h 第 102 行定义.
被这些函数引用 eve::procgen::TerrainStreamingCache::buildWindow(), eve::procgen::TerrainStreamingCache::sampleCell() , 以及 eve::procgen::TerrainStreamingCache::sampleHeight().
◆ loadChunk()
| bool eve::procgen::TerrainAsset::loadChunk | ( | int | chunkX, |
| int | chunkY, | ||
| TerrainChunkData & | out, | ||
| std::string * | error = nullptr |
||
| ) | const |
Compatibility operation that loads and verifies one chunk.
在文件 TerrainAsset.cpp 第 282 行定义.
引用了 biome, eve::procgen::TerrainChunkData::biomes, cells, eve::procgen::TerrainChunkData::chunkX, eve::procgen::TerrainChunkData::chunkY, eve::procgen::Heightmap::data(), direction, error, findChunk(), eve::procgen::TerrainChunkData::flowAccumulation, eve::procgen::TerrainChunkData::flowDirection, eve::procgen::TerrainChunkData::flowVectorX, eve::procgen::TerrainChunkData::flowVectorY, eve::procgen::TerrainChunkData::height, eve::procgen::TerrainChunkData::heights, eve::procgen::TerrainChunkData::lakeDepth, eve::procgen::TerrainChunkData::moisture, p, eve::procgen::Heightmap::resize(), eve::procgen::TerrainChunkData::rivers, stored, eve::procgen::TerrainChunkData::streamOrder, eve::procgen::TerrainChunkData::temperature, eve::procgen::Wetland , 以及 eve::procgen::TerrainChunkData::width.
被这些函数引用 eve::procgen::TerrainStreamingCache::streamAround().
◆ open()
| bool eve::procgen::TerrainAsset::open | ( | const uint8_t * | data, |
| size_t | size, | ||
| std::string * | error = nullptr |
||
| ) |
Compatibility operation that opens only the header and directory.
在文件 TerrainAsset.cpp 第 175 行定义.
◆ openSource()
| Result< void > eve::procgen::TerrainAsset::openSource | ( | std::shared_ptr< const ITerrainArchiveSource > | source | ) |
Open only EVTR metadata from a shared immutable random-access source.
- 参数
-
source Shared owner that remains retained for later chunk reads.
- 返回
- Success after validating the complete header and directory; failure publishes no state. @thread The asset is not safe to mutate concurrently; chunk reads inherit source read safety.
在文件 TerrainAsset.cpp 第 184 行定义.
引用了 count, error, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::ParseError, source , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/procgen/heightmap/TerrainAsset.h
- src/modules/procgen/heightmap/TerrainAsset.cpp