34#define HMAP_FCT_XY_TYPE std::function<float(float, float, float)>
36#define HMAP_GRADIENT_OFFSET 0.001f
99 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
118 this->array = new_array;
139 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
164 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
189 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
224 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
251 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
268 this->sigma = new_sigma;
269 this->inv_sigma2 = 1.f / (this->sigma * this->sigma);
291 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
318 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
342 this->angle = new_angle;
368 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
392 this->angle = new_angle;
419 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
437 this->angle = new_angle;
462 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
480 this->angle = new_angle;
506 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
526 glm::vec2
center = {0.5f, 0.5f});
535 this->angle = new_angle;
564 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
578 glm::vec2
center = {0.5f, 0.5f});
587 this->angle = new_angle;
613 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
627 glm::vec2
center = {0.5f, 0.5f});
636 this->angle = new_angle;
663 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
679 glm::vec2
center = {0.5f, 0.5f});
688 this->angle = new_angle;
770 this->
seed = new_seed;
797 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
833 int perlin_b = 0X100;
838 int perlin_bm = 0xff;
843 int perlin_n = 0x100;
853 std::vector<std::vector<float>> g2;
858 std::vector<float> m;
867 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
889 bool return_cell_value =
false;
898 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
920 bool return_cell_value =
false;
929 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
954 bool return_cell_value =
false;
963 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
985 bool return_cell_value =
false;
994 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1016 bool return_cell_value =
false;
1025 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1047 bool return_cell_value =
false;
1056 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1078 bool return_cell_value =
false;
1087 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1109 bool return_cell_value =
false;
1118 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1154 std::function<float(
float,
float,
float)>
itp_fct;
1163 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1199 std::function<float(
float,
float,
float)>
itp_fct;
1208 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1219 bool return_cell_value =
false);
1232 bool return_cell_value =
false;
1241 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1275 bool return_cell_value =
false;
1317 this->base.set_kw(new_kw);
1327 this->lacunarity = new_lacunarity;
1337 this->octaves = new_octaves;
1348 this->persistence = new_persistence;
1360 this->base.set_seed(new_seed);
1382 float new_stretch_decay = 0.f)
1384 this->
angle = new_angle;
1388 float theta = new_angle * 3.14159265358979323846f / 180.f;
1389 this->
cos_a = std::cos(theta);
1390 this->
sin_a = std::sin(theta);
1400 return this->lacunarity;
1410 return this->octaves;
1420 return this->persistence;
1430 return this->weight;
1445 if (this->
stretch == 1.f)
return;
1447 float decay = std::pow(1.f - std::clamp(this->
stretch_decay, 0.f, 1.f),
1448 static_cast<float>(octave));
1449 float stretch_k = 1.f + (this->
stretch - 1.f) * decay;
1450 float inv_stretch = 1.f / std::max(stretch_k, 1e-6f);
1452 float xl = x * this->
cos_a + y * this->
sin_a;
1453 float yl = -x * this->sin_a + y * this->
cos_a;
1455 x = xl * this->cos_a - yl * this->sin_a;
1456 y = xl * this->sin_a + yl * this->cos_a;
1477template <
typename BaseFn>
1481 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1503template <
typename BaseFn>
1507 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1533 this->gradient_scale = new_gradient_scale;
1544template <
typename BaseFn>
1548 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1580 this->warp0 = new_warp0;
1590 this->damp0 = new_damp0;
1600 this->warp_scale = new_warp_scale;
1610 this->damp_scale = new_damp_scale;
1624template <
typename BaseFn>
1628 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1663template <
typename BaseFn>
1667 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1693 this->k_smoothing = new_k_smoothing;
1707template <
typename BaseFn>
1711 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1744 void set_bias(
float new_bias_angle,
float new_bias_strength)
1747 this->
bias_strength = std::clamp(new_bias_strength, 0.f, 1.f);
1748 float theta = new_bias_angle * 3.14159265358979323846f / 180.f;
1760 this->gradient_scale = new_gradient_scale;
1770 this->slope_power = new_slope_power;
1780 this->octave_blend = new_octave_blend;
1797template <
typename BaseFn>
1801 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1827 this->warp_scale = new_warp_scale;
1847 float operator()(
float x,
float y,
float ctrl_param = 0.f)
const;
1869 std::vector<float>
xr,
1870 std::vector<float>
yr,
1871 std::vector<float>
zr);
1930template <
typename Fn>
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Axis-aligned 2D bounding box in world coordinates.
ArrayFunction(Array array, glm::vec2 kw, bool periodic=true)
Construct a new ArrayFunction object.
Definition functions.cpp:48
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:53
bool periodic
Flag indicating whether the domain is periodic or not.
Definition functions.hpp:123
glm::vec2 kw
Frequency scaling vector.
Definition functions.hpp:122
void set_array(Array new_array)
Set the array object.
Definition functions.hpp:116
Array class, helper to manipulate 2D float array with "(i, j)" indexing.
Definition array.hpp:31
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:97
BiquadFunction(float gain, glm::vec2 center)
Construct a new Biquad Function object.
Definition functions.cpp:92
glm::vec2 center
Primitive reference center.
Definition functions.hpp:151
float gain
Gain value that controls the steepness of the bump.
Definition functions.hpp:150
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:116
glm::vec2 center
Primitive reference center.
Definition functions.hpp:176
BumpFunction(float gain, glm::vec2 center)
Construct a new Bump Function object.
Definition functions.cpp:111
float gain
Gain value that controls the steepness of the bump.
Definition functions.hpp:175
CraterFunction(float radius, float depth, float lip_decay, float lip_height_ratio, glm::vec2 center)
Construct a new Crater Function object.
Definition functions.cpp:132
float depth
Depth of the crater.
Definition functions.hpp:211
float lip_decay
Decay rate of the crater's lip.
Definition functions.hpp:212
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:145
glm::vec2 center
Primitive reference center.
Definition functions.hpp:214
float radius
Radius of the crater.
Definition functions.hpp:210
float lip_height_ratio
Height ratio of the crater's lip.
Definition functions.hpp:213
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:165
glm::vec2 center
Primitive reference center.
Definition functions.hpp:238
float radius
Radius of the disk.
Definition functions.hpp:236
float slope
Slope of the disk.
Definition functions.hpp:237
DiskFunction(float radius, float slope, glm::vec2 center)
Construct a new Disk Function object.
Definition functions.cpp:160
FbmFunction(BaseFn base, int octaves, float weight, float persistence, float lacunarity)
Construct a new Fbm Function object.
Definition functions.inl:46
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.inl:60
void set_gradient_scale(float new_gradient_scale)
Set the gradient scale.
Definition functions.hpp:1531
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.inl:104
FbmIqFunction(BaseFn base, int octaves, float weight, float persistence, float lacunarity, float gradient_scale)
Construct a new Fbm Iq Function object.
Definition functions.inl:88
float gradient_scale
Gradient scale influence.
Definition functions.hpp:1537
void set_damp_scale(float new_damp_scale)
Set the damp scale.
Definition functions.hpp:1608
void set_damp0(float new_damp0)
Set the initial damp.
Definition functions.hpp:1588
float warp0
Initial warp.
Definition functions.hpp:1614
float warp_scale
Warp scale.
Definition functions.hpp:1616
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.inl:167
void set_warp0(float new_warp0)
Set the initial warp.
Definition functions.hpp:1578
float damp_scale
Damp scale.
Definition functions.hpp:1617
void set_warp_scale(float new_warp_scale)
Set the warp scale.
Definition functions.hpp:1598
FbmJordanFunction(BaseFn base, int octaves, float weight, float persistence, float lacunarity, float warp0, float damp0, float warp_scale, float damp_scale)
Construct a new Fbm Jordan Function object.
Definition functions.inl:145
float damp0
Initial damp.
Definition functions.hpp:1615
void set_k_smoothing(float new_k_smoothing)
Set the smoothing parameter.
Definition functions.hpp:1650
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.inl:240
FbmPingpongFunction(BaseFn base, int octaves, float weight, float persistence, float lacunarity)
Construct a new Fbm Pingpong Function object.
Definition functions.inl:226
float k_smoothing
Smoothing parameter.
Definition functions.hpp:1656
FbmRidgedFunction(BaseFn base, int octaves, float weight, float persistence, float lacunarity, float k_smoothing)
Construct a new Fbm Ridged Function object.
Definition functions.inl:270
void set_k_smoothing(float new_k_smoothing)
Set the smoothing parameter.
Definition functions.hpp:1691
float k_smoothing
Smoothing parameter.
Definition functions.hpp:1697
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.inl:286
float bias_cos
Cosine of directional bias angle.
Definition functions.hpp:1789
FbmSlopeFunction(BaseFn base, int octaves, float weight, float persistence, float lacunarity, float gradient_scale, float slope_power, float octave_blend, float bias_angle=0.f, float bias_strength=0.f)
Construct a new Fbm Slope Function object.
Definition functions.inl:314
float bias_angle
Preferred slope direction angle in degrees.
Definition functions.hpp:1787
void set_gradient_scale(float new_gradient_scale)
Set the gradient scale.
Definition functions.hpp:1758
void set_bias(float new_bias_angle, float new_bias_strength)
Set the directional bias.
Definition functions.hpp:1744
void set_octave_blend(float new_octave_blend)
Set the octave blend rate.
Definition functions.hpp:1778
float gradient_scale
Gradient scale influence.
Definition functions.hpp:1784
float bias_strength
Directional bias strength in [0, 1].
Definition functions.hpp:1788
float bias_sin
Sine of directional bias angle.
Definition functions.hpp:1790
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.inl:337
void set_slope_power(float new_slope_power)
Set the slope power.
Definition functions.hpp:1768
float slope_power
Exponent controlling slope transition sharpness.
Definition functions.hpp:1785
float octave_blend
Rate at which higher octaves become slope-masked.
Definition functions.hpp:1786
void set_warp_scale(float new_warp_scale)
Set the warp scale.
Definition functions.hpp:1825
float warp_scale
Warping scale.
Definition functions.hpp:1832
float warp_scale_normalized
Normalized warping scale.
Definition functions.hpp:1833
FbmSwissFunction(BaseFn base, int octaves, float weight, float persistence, float lacunarity, float warp_scale)
Construct a new Fbm Swiss Function object.
Definition functions.inl:396
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.inl:412
FieldFunction(BaseFn base)
Construct a new FieldFunction object.
Definition functions.inl:456
void set_yr(std::vector< float > new_yr)
Set the y coordinates representing the centers of the primitive.
Definition functions.hpp:1888
std::vector< float > yr
Definition functions.hpp:1907
void set_zr(std::vector< float > new_zr)
Set the z coordinates used to scale the primitive in x and y directions, and also to scale the primit...
Definition functions.hpp:1899
std::vector< float > zr
directions, and to scale the primitive amplitude if requested.
Definition functions.hpp:1909
void set_xr(std::vector< float > new_xr)
Set the x coordinates representing the centers of the primitive.
Definition functions.hpp:1878
std::vector< float > xr
Definition functions.hpp:1905
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.inl:474
glm::vec2 center
Primitive reference center.
Definition functions.hpp:274
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:186
float sigma
Pulse half-width.
Definition functions.hpp:273
GaussianPulseFunction(float sigma, glm::vec2 center)
Construct a new GaussianPulse Function object.
Definition functions.cpp:180
void set_sigma(float new_sigma)
Set the half-width.
Definition functions.hpp:266
float stretch_decay
Stretching decay across octaves.
Definition functions.hpp:1468
void set_seed(std::uint32_t new_seed)
Set a new random seed for the noise generation.
Definition functions.hpp:1357
float get_persistence() const
Get the persistence of the fractal noise.
Definition functions.hpp:1418
BaseFn base
Unique pointer to the base noise function.
Definition functions.hpp:1460
GenericFractalFunction(BaseFn base, int octaves, float weight, float persistence, float lacunarity)
Construct a new GenericFractalFunction object.
Definition functions.inl:18
float persistence
Persistence of the fractal noise.
Definition functions.hpp:1463
float lacunarity
Lacunarity of the fractal noise.
Definition functions.hpp:1464
int get_octaves() const
Get the number of octaves in the fractal noise.
Definition functions.hpp:1408
float angle
Direction angle in degrees.
Definition functions.hpp:1466
void update_amp0()
Update the initial amplitude (amp0) based on the current octaves and persistence.
Definition functions.inl:33
void scale_amp0(float scale)
Scale the initial amplitude of the fractal noise.
Definition functions.hpp:1368
void set_stretch(float new_angle, float new_stretch, float new_stretch_decay=0.f)
Configure directional stretching for the fractal noise.
Definition functions.hpp:1380
void apply_stretch(float &x, float &y, int octave) const
Apply directional stretching to coordinates for a given octave.
Definition functions.hpp:1443
float weight
Weight of the base noise function.
Definition functions.hpp:1462
float cos_a
Cosine of direction angle.
Definition functions.hpp:1469
float amp0
Initial amplitude of the fractal noise.
Definition functions.hpp:1465
void set_lacunarity(float new_lacunarity)
Set the lacunarity of the fractal noise.
Definition functions.hpp:1325
float get_weight() const
Get the weight of the fractal noise.
Definition functions.hpp:1428
float get_lacunarity() const
Get the lacunarity of the fractal noise.
Definition functions.hpp:1398
int octaves
Number of octaves in the fractal noise.
Definition functions.hpp:1461
void set_octaves(int new_octaves)
Set the number of octaves in the fractal noise.
Definition functions.hpp:1335
float stretch
Stretching factor along the direction.
Definition functions.hpp:1467
void set_kw(glm::vec2 new_kw)
Set the frequency scaling vector.
Definition functions.hpp:1314
float sin_a
Sine of direction angle.
Definition functions.hpp:1470
void set_persistence(float new_persistence)
Set the persistence of the fractal noise.
Definition functions.hpp:1346
glm::vec2 kw
Frequency scaling vector.
Definition functions.hpp:783
glm::vec2 get_kw() const
Get the frequency scaling vector.
Definition functions.hpp:750
void set_kw(glm::vec2 new_kw)
Set a new frequency scaling vector.
Definition functions.hpp:777
std::uint32_t get_seed() const
Get the random seed.
Definition functions.hpp:759
NoiseFunction(glm::vec2 kw, std::uint32_t seed)
Constructor to initialize with specific frequency scaling and seed.
Definition functions.hpp:742
NoiseFunction()
Default constructor. Initializes with default frequency scaling and seed.
Definition functions.hpp:725
NoiseFunction(glm::vec2 kw)
Constructor to initialize with specific frequency scaling.
Definition functions.hpp:733
void set_seed(std::uint32_t new_seed)
Set a new random seed for noise generation.
Definition functions.hpp:768
std::uint32_t seed
Random seed for noise generation.
Definition functions.hpp:784
void initialize()
Initialize generator.
Definition parberry_function.cpp:30
ParberryFunction(glm::vec2 kw, std::uint32_t seed, float mu)
Construct a new Perlin Function object.
Definition parberry_function.cpp:20
float mu
Gradient magnitude exponent.
Definition functions.hpp:802
float operator()(float x, float y, float ctrl_param=0.f) const
Definition parberry_function.cpp:68
void set_seed(std::uint32_t)
Set the seed attribute.
Definition functions.hpp:824
PerlinBillowFunction(glm::vec2 kw, std::uint32_t seed)
Construct a new Perlin Function object.
Definition noise_functions.cpp:292
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:914
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:297
PerlinFunction(glm::vec2 kw, std::uint32_t seed)
Construct a new Perlin Function object.
Definition noise_functions.cpp:282
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:883
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:287
PerlinHalfFunction(glm::vec2 kw, std::uint32_t seed, float k)
Construct a new Perlin Function object.
Definition noise_functions.cpp:303
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:310
float k
Definition functions.hpp:931
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:948
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:321
PerlinMixFunction(glm::vec2 kw, std::uint32_t seed)
Construct a new Perlin Function object.
Definition noise_functions.cpp:316
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:979
float c11
Top-right value.
Definition functions.hpp:307
QuadSurfaceFunction(float c00, float c10, float c01, float c11)
Construct a new QuadSurface Function object.
Definition functions.cpp:196
float c10
Bottom-right value.
Definition functions.hpp:305
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:204
float c00
Bottom-left value.
Definition functions.hpp:304
BBox2D bbox
Domain bounding box.
Definition functions.hpp:308
float c01
Top-left value.
Definition functions.hpp:306
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:221
void set_angle(float new_angle)
Set the angle.
Definition functions.hpp:340
float rx
Definition functions.hpp:348
float ry
Radius of the rectangle.
Definition functions.hpp:348
float slope
Slope of the rectangle.
Definition functions.hpp:350
glm::vec2 center
Primitive reference center.
Definition functions.hpp:351
float angle
Angle of the rectangle.
Definition functions.hpp:349
RectangleFunction(float rx, float ry, float angle, float slope, glm::vec2 center)
Construct a new Rectangle Function object.
Definition functions.cpp:211
bool sharp_bottom
Rift bottom sharpness.
Definition functions.hpp:401
float angle
Overall rotation angle (in degrees).
Definition functions.hpp:398
glm::vec2 center
Primitive reference center.
Definition functions.hpp:402
RiftFunction(float angle, float slope, float width, bool sharp_bottom, glm::vec2 center)
Construct a new Rift Function object.
Definition functions.cpp:254
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:264
float width
Rift width.
Definition functions.hpp:400
void set_angle(float new_angle)
Set the angle.
Definition functions.hpp:390
float slope
Rift slope.
Definition functions.hpp:399
Simplex2Function(glm::vec2 kw, std::uint32_t seed)
Construct a new Perlin Function object.
Definition noise_functions.cpp:327
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:332
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:1010
Simplex2SFunction(glm::vec2 kw, std::uint32_t seed)
Construct a new Perlin Function object.
Definition noise_functions.cpp:337
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:1041
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:342
float slope
Step slope.
Definition functions.hpp:444
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:288
void set_angle(float new_angle)
Set the angle.
Definition functions.hpp:435
SlopeFunction(float angle, float slope, glm::vec2 center)
Construct a new Slope Function object.
Definition functions.cpp:282
glm::vec2 center
Primitive reference center.
Definition functions.hpp:445
float angle
Overall rotation angle (in degrees).
Definition functions.hpp:443
float angle
Overall rotation angle (in degrees).
Definition functions.hpp:486
StepFunction(float angle, float slope, glm::vec2 center)
Construct a new Step Function object.
Definition functions.cpp:294
glm::vec2 center
Primitive reference center.
Definition functions.hpp:488
float slope
Step slope.
Definition functions.hpp:487
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:300
void set_angle(float new_angle)
Set the angle.
Definition functions.hpp:478
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:363
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:1103
ValueCubicNoiseFunction(glm::vec2 kw, std::uint32_t seed)
Construct a new ValueCubicNoiseFunction object.
Definition noise_functions.cpp:357
void update_interpolation_function()
Update base interpolation.
Definition noise_functions.cpp:377
ValueDelaunayNoiseFunction(glm::vec2 kw, std::uint32_t seed)
Construct a new ValueNoiseFunction object.
Definition noise_functions.cpp:368
void set_kw(glm::vec2 new_kw)
Set the wavenumber attribute.
Definition functions.hpp:1133
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:1144
std::function< float(float, float, float)> itp_fct
Definition functions.hpp:1154
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:454
ValueLinearNoiseFunction(glm::vec2 kw, std::uint32_t seed)
Construct a new ValueLinearNoiseFunction object.
Definition noise_functions.cpp:461
std::function< float(float, float, float)> itp_fct
Definition functions.hpp:1199
void update_interpolation_function()
Update base interpolation.
Definition noise_functions.cpp:470
void set_kw(glm::vec2 new_kw)
Set the wavenumber attribute.
Definition functions.hpp:1178
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:1189
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:523
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:352
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:1072
ValueNoiseFunction(glm::vec2 kw, std::uint32_t seed)
Construct a new ValueNoiseFunction object.
Definition noise_functions.cpp:347
glm::vec2 kw
Frequency scaling vector.
Definition functions.hpp:541
glm::vec2 center
Primitive reference center.
Definition functions.hpp:547
float xbottom
1]).
Definition functions.hpp:544
float xtop
Relative location of the top of the dune profile (in [0, 1]).
Definition functions.hpp:543
float angle
Overall rotation angle (in degrees).
Definition functions.hpp:542
void set_angle(float new_angle)
Set the angle.
Definition functions.hpp:533
float phase_shift
Phase shift (in radians).
Definition functions.hpp:546
WaveDuneFunction(glm::vec2 kw, float angle, float xtop, float xbottom, float phase_shift, glm::vec2 center={0.5f, 0.5f})
Construct a new Wave Dune Function object.
Definition functions.cpp:317
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:332
glm::vec2 kw
Frequency scaling vector.
Definition functions.hpp:593
WaveSineFunction(glm::vec2 kw, float angle, float phase_shift, glm::vec2 center={0.5f, 0.5f})
Construct a new Wave Sine Function object.
Definition functions.cpp:353
glm::vec2 center
Primitive reference center.
Definition functions.hpp:596
void set_angle(float new_angle)
Set the angle.
Definition functions.hpp:585
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:362
float angle
Overall rotation angle (in degrees).
Definition functions.hpp:594
float phase_shift
Phase shift (in radians).
Definition functions.hpp:595
WaveSquareFunction(glm::vec2 kw, float angle, float phase_shift, glm::vec2 center={0.5f, 0.5f})
Construct a new Wave Square Function object.
Definition functions.cpp:369
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:378
void set_angle(float new_angle)
Set the angle.
Definition functions.hpp:634
float phase_shift
Phase shift (in radians).
Definition functions.hpp:644
glm::vec2 center
Primitive reference center.
Definition functions.hpp:645
glm::vec2 kw
Frequency scaling vector.
Definition functions.hpp:642
float angle
Overall rotation angle (in degrees).
Definition functions.hpp:643
WaveTriangularFunction(glm::vec2 kw, float angle, float slant_ratio, float phase_shift, glm::vec2 center={0.5f, 0.5f})
Construct a new Wave Triangular Function object.
Definition functions.cpp:385
float slant_ratio
Relative location of the triangle apex, in [0, 1].
Definition functions.hpp:696
glm::vec2 kw
Frequency scaling vector.
Definition functions.hpp:694
float angle
Overall rotation angle (in degrees).
Definition functions.hpp:695
float phase_shift
Phase shift (in radians).
Definition functions.hpp:697
float operator()(float x, float y, float ctrl_param=0.f) const
Definition functions.cpp:395
glm::vec2 center
Primitive reference center.
Definition functions.hpp:698
void set_angle(float new_angle)
Set the angle.
Definition functions.hpp:686
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:538
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:1269
float ratio
Amplitude ratio between each Worley noise.
Definition functions.hpp:1246
WorleyDoubleFunction(glm::vec2 kw, std::uint32_t seed, float ratio, float k)
Construct a new Worley Double Function object.
Definition noise_functions.cpp:530
float k
Transition smoothing parameter.
Definition functions.hpp:1251
float operator()(float x, float y, float ctrl_param=0.f) const
Definition noise_functions.cpp:559
void set_seed(std::uint32_t new_seed)
Set the seed attribute.
Definition functions.hpp:1226
WorleyFunction(glm::vec2 kw, std::uint32_t seed, bool return_cell_value=false)
Construct a new Worley Function object.
Definition noise_functions.cpp:552
constexpr float pi
Definition constants.hpp:16
std::function< float(float, float)> make_xy_function_from_array(const Array &array, const BBox2D &bbox=BBox2D::unit())
Create a continuous 2D function from a sampled array.
Definition functions.cpp:16
Cloud scale(const Cloud &cloud, glm::vec2 scale, glm::vec2 center={0.5f, 0.5f})
Scales the point coordinates in a cloud relative to a center point.
Definition cloud_functions.cpp:163
NoiseType
Enumeration of various noise types used for procedural generation.
Definition functions.hpp:67
@ WORLEY
Worley.
Definition functions.hpp:78
@ SIMPLEX2S
OpenSimplex2S.
Definition functions.hpp:73
@ WORLEY_DOUBLE
Worley double.
Definition functions.hpp:79
@ VALUE_DELAUNAY
Value (delaunay).
Definition functions.hpp:76
@ PERLIN_BILLOW
Perlin billow.
Definition functions.hpp:70
@ PARBERRY
Parberry (Perlin variant).
Definition functions.hpp:68
@ WORLEY_VALUE
Worley (cell value return).
Definition functions.hpp:80
@ PERLIN
Perlin.
Definition functions.hpp:69
@ SIMPLEX2
OpenSimplex2.
Definition functions.hpp:72
@ PERLIN_HALF
Perlin half.
Definition functions.hpp:71
@ VALUE_LINEAR
Value (linear).
Definition functions.hpp:77
@ VALUE_CUBIC
Value (cubic).
Definition functions.hpp:75
@ VALUE
Value.
Definition functions.hpp:74
decltype(auto) with_noise_function(NoiseType noise_type, glm::vec2 kw, std::uint32_t seed, Fn &&fn)
Dispatch a noise functor based on the specified noise type.
Definition functions.inl:493
Axis-aligned 2D bounding box in world coordinates.
Definition bbox2d.hpp:25
static constexpr BBox2D unit()
Definition bbox2d.hpp:39