![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
Procedural generation utilities. More...
Classes | |
class | gf::Heightmap |
A heightmap. More... | |
class | gf::Noise2D |
2D A noise function More... | |
class | gf::Noise3D |
3D A noise function More... | |
class | gf::ValueNoise2D |
Value 2D noise. More... | |
class | gf::GradientNoise2D |
Gradient 2D noise. More... | |
class | gf::GradientNoise3D |
Gradient 3D noise. More... | |
class | gf::BetterGradientNoise2D |
Better gradient 2D noise. More... | |
class | gf::FractalNoise2D |
Fractal 2D noise. More... | |
class | gf::FractalNoise3D |
Fractal 3D noise. More... | |
class | gf::PerlinNoise2D |
Perlin 2D noise. More... | |
class | gf::PerlinNoise3D |
Perlin 3D noise. More... | |
class | gf::SimplexNoise2D |
Simplex 2D noise. More... | |
class | gf::OpenSimplexNoise2D |
OpenSimplex 2D noise. More... | |
class | gf::OpenSimplexNoise3D |
OpenSimplex3D noise. More... | |
class | gf::WaveletNoise3D |
Wavelet 3D noise. More... | |
class | gf::WorleyNoise2D |
Worley 2D noise. More... | |
class | gf::Multifractal2D |
Multi Fractal 2D noise. More... | |
class | gf::HeteroTerrain2D |
Hetero Terrain 2D noise. More... | |
class | gf::HybridMultifractal2D |
Hybrid Multifractal 2D noise. More... | |
class | gf::RidgedMultifractal2D |
Ridged Multifractal 2D noise. More... | |
class | gf::Noise3DTo2DAdapter |
An adapter that make a 2D noise from a 3D noise. More... | |
Functions | |
GF_CORE_API std::vector< Vector2f > | gf::midpointDisplacement1D (Vector2f p0, Vector2f p1, Random &random, unsigned iterations, Vector2f direction, float initialFactor=1.0f, float reductionFactor=0.5f) |
1D midpoint displacement More... | |
GF_CORE_API std::vector< Vector2f > | gf::midpointDisplacement1D (Vector2f p0, Vector2f p1, Random &random, unsigned iterations, float initialFactor=1.0f, float reductionFactor=0.5f) |
1D midpoint displacement More... | |
GF_CORE_API Heightmap | gf::midpointDisplacement2D (Vector2i size, Random &random, Span< const double > initialValues=nullptr) |
2D midpoint displacement More... | |
GF_CORE_API Heightmap | gf::diamondSquare2D (Vector2i size, Random &random, Span< const double > initialValues=nullptr) |
2D diamond square More... | |
Procedural generation utilities.
GF_CORE_API Heightmap gf::diamondSquare2D | ( | Vector2i | size, |
Random & | random, | ||
Span< const double > | initialValues = nullptr |
||
) |
2D diamond square
The size can be anything. If the size is not a power of two plus one, then a greater heightmap is generated and a submap of the right size is returned (in the middle of the generated map).
The function takes initial values. If there are less than three values, only the first one is used to initialize the four corners. If there are more than four, only the first four are used to initialize the four corners in that order: north-west, north-east, south-east, south-west. If no values are given, the four corners are initialized to \( 0.0 \).
size | The size of the map |
random | A random engine |
initialValues | The initial values of the four corners |
GF_CORE_API std::vector< Vector2f > gf::midpointDisplacement1D | ( | Vector2f | p0, |
Vector2f | p1, | ||
Random & | random, | ||
unsigned | iterations, | ||
float | initialFactor = 1.0f , |
||
float | reductionFactor = 0.5f |
||
) |
1D midpoint displacement
The direction is perpendicular to the segment \( [P_0 P_1] \)
p0 | The first end point |
p1 | The second end point |
random | A random engine |
iterations | The number of iterations |
initialFactor | The initial factor to apply to the displacement |
reductionFactor | The factor to apply at each iteration |
GF_CORE_API std::vector< Vector2f > gf::midpointDisplacement1D | ( | Vector2f | p0, |
Vector2f | p1, | ||
Random & | random, | ||
unsigned | iterations, | ||
Vector2f | direction, | ||
float | initialFactor = 1.0f , |
||
float | reductionFactor = 0.5f |
||
) |
1D midpoint displacement
p0 | The first end point |
p1 | The second end point |
random | A random engine |
iterations | The number of iterations |
direction | The direction to make a displacement |
initialFactor | The initial factor to apply to the displacement |
reductionFactor | The factor to apply at each iteration |
GF_CORE_API Heightmap gf::midpointDisplacement2D | ( | Vector2i | size, |
Random & | random, | ||
Span< const double > | initialValues = nullptr |
||
) |
2D midpoint displacement
The size can be anything. If the size is not a power of two plus one, then a greater heightmap is generated and a submap of the right size is returned (in the middle of the generated map).
The function takes initial values. If there are less than three values, only the first one is used to initialize the four corners. If there are more than four, only the first four are used to initialize the four corners in that order: north-west, north-east, south-east, south-west. If no values are given, the four corners are initialized to \( 0.0 \).
size | The size of the map |
random | A random engine |
initialValues | The initial values of the four corners |