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

In-memory terrain heightmap: a dense float grid (row-major, index = y * width + x) materialized from a TerrainSampler or filled by hand. 更多...

#include <Heightmap.h>

Public 成员函数

 Heightmap ()=default
 
 Heightmap (int width, int height)
 
void resize (int width, int height)
 
int getWidth () const
 
int getHeight () const
 
bool inBounds (int x, int y) const
 
void setHeight (int x, int y, float h)
 
float height (int x, int y) const
 
float sampleBilinear (float x, float y) const
 Bilinear height at continuous coordinate within [0, w) x [0, h).
 
float sampleBilinearSeamless (float x, float y) const
 Bilinear height with wrap-around (seamless tiling).
 
const std::vector< float > & data () const
 
bool toGrid (Grid2D &out, const TerrainBands &bands) const
 Classify heights into a semantic Grid2D (source for tilemap generation).
 

静态 Public 成员函数

static Heightmap generate (const TerrainSampler &sampler, int width, int height)
 Materialize a Heightmap by sampling sampler at every pixel center.
 

详细描述

In-memory terrain heightmap: a dense float grid (row-major, index = y * width + x) materialized from a TerrainSampler or filled by hand.

Use generate() to sample a TerrainSampler per-pixel, height(x, y) / sampleBilinear(x, y) to read values back, and toGrid() to classify the heights into a semantic Grid2D ready for tilemap generation.

在文件 Heightmap.h19 行定义.

构造及析构函数说明

◆ Heightmap() [1/2]

eve::procgen::Heightmap::Heightmap ( )
default

◆ Heightmap() [2/2]

eve::procgen::Heightmap::Heightmap ( int  width,
int  height 
)

在文件 Heightmap.cpp8 行定义.

引用了 height, resize() , 以及 width.

成员函数说明

◆ data()

const std::vector< float > & eve::procgen::Heightmap::data ( ) const
inline

在文件 Heightmap.h37 行定义.

◆ generate()

Heightmap eve::procgen::Heightmap::generate ( const TerrainSampler sampler,
int  width,
int  height 
)
static

◆ getHeight()

int eve::procgen::Heightmap::getHeight ( ) const

在文件 Heightmap.cpp17 行定义.

◆ getWidth()

int eve::procgen::Heightmap::getWidth ( ) const

在文件 Heightmap.cpp16 行定义.

◆ height()

float eve::procgen::Heightmap::height ( int  x,
int  y 
) const

在文件 Heightmap.cpp28 行定义.

引用了 inBounds(), x , 以及 y.

◆ inBounds()

bool eve::procgen::Heightmap::inBounds ( int  x,
int  y 
) const

在文件 Heightmap.cpp19 行定义.

引用了 x , 以及 y.

被这些函数引用 height() , 以及 setHeight().

◆ resize()

void eve::procgen::Heightmap::resize ( int  width,
int  height 
)

在文件 Heightmap.cpp10 行定义.

引用了 height , 以及 width.

被这些函数引用 Heightmap().

◆ sampleBilinear()

float eve::procgen::Heightmap::sampleBilinear ( float  x,
float  y 
) const

Bilinear height at continuous coordinate within [0, w) x [0, h).

在文件 Heightmap.cpp37 行定义.

引用了 x , 以及 y.

◆ sampleBilinearSeamless()

float eve::procgen::Heightmap::sampleBilinearSeamless ( float  x,
float  y 
) const

Bilinear height with wrap-around (seamless tiling).

在文件 Heightmap.cpp52 行定义.

引用了 px, x , 以及 y.

◆ setHeight()

void eve::procgen::Heightmap::setHeight ( int  x,
int  y,
float  h 
)

在文件 Heightmap.cpp23 行定义.

引用了 h, inBounds(), x , 以及 y.

被这些函数引用 generate().

◆ toGrid()

bool eve::procgen::Heightmap::toGrid ( Grid2D out,
const TerrainBands bands 
) const

Classify heights into a semantic Grid2D (source for tilemap generation).

在文件 Heightmap.cpp84 行定义.

引用了 eve::procgen::Grid2D::resize(), eve::procgen::TerrainBands::semanticAt(), eve::procgen::Grid2D::setCell(), x , 以及 y.

被这些函数引用 eve::procgen::Procgen::heightmapToGrid().


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