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

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

const TerrainAsset & eve::procgen::TerrainStreamingCache::asset ( ) const
inline

Asset.

在文件 TerrainStreaming.h 第 101 行定义.

被这些函数引用 eve::voxel::VoxelWorld::streamAround().

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

被这些函数引用 eve::voxel::VoxelWorld::disableTerrain().

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

int eve::procgen::TerrainStreamingCache::getResidentCount ( ) const
inline

Returns the resident count.

在文件 TerrainStreaming.h 第 99 行定义.

被这些函数引用 streamAround().

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

引用了 error , 以及 size.

被这些函数引用 eve::voxel::VoxelWorld::loadTerrainAsset().

◆ 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

◆ 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.

被这些函数引用 eve::voxel::VoxelWorld::terrainHeightAt().

◆ 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.

参数
radiusChunksCircular residency radius in chunks; negative is a no-op.
maxLoadsMaximum 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.

参数
maxStepsSafety limit; must be positive.
outGlobal 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.


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