载入中...
搜索中...
未找到
eve::procgen::TerrainAsset类 参考

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()

◆ chunks()

const std::vector< TerrainChunkEntry > & eve::procgen::TerrainAsset::chunks ( ) const
inline

Chunks.

在文件 TerrainAsset.h 第 112 行定义.

◆ findChunk()

const TerrainChunkEntry * eve::procgen::TerrainAsset::findChunk ( int  chunkX,
int  chunkY 
) const
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()

int eve::procgen::TerrainAsset::getChunkSize ( ) const
inline

◆ getHeight()

int eve::procgen::TerrainAsset::getHeight ( ) const
inline

◆ getMaxHeight()

float eve::procgen::TerrainAsset::getMaxHeight ( ) const
inline

Returns the max height.

在文件 TerrainAsset.h 第 110 行定义.

◆ getMinHeight()

float eve::procgen::TerrainAsset::getMinHeight ( ) const
inline

Returns the min height.

在文件 TerrainAsset.h 第 108 行定义.

◆ getWidth()

int eve::procgen::TerrainAsset::getWidth ( ) const
inline

◆ loadChunk()

◆ 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 行定义.

引用了 error, size , 以及 source.

◆ openSource()

Result< void > eve::procgen::TerrainAsset::openSource ( std::shared_ptr< const ITerrainArchiveSource >  source)

Open only EVTR metadata from a shared immutable random-access source.

参数
sourceShared 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().


该类的文档由以下文件生成: