mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix MapgenV6::getGroundLevelAtPoint()
This commit is contained in:
parent
631a835e07
commit
1cd8351054
3 changed files with 56 additions and 5 deletions
24
src/noise.h
24
src/noise.h
|
@ -132,8 +132,28 @@ inline float easeCurve(float t) {
|
|||
return t * t * t * (t * (6.f * t - 15.f) + 10.f);
|
||||
}
|
||||
|
||||
#define NoisePerlin2D(np, x, y, s) ((np)->offset + (np)->scale * \
|
||||
noise2d_perlin((float)(x) / (np)->spread.X, (float)(y) / (np)->spread.Y, \
|
||||
#define NoisePerlin2D(np, x, y, s) \
|
||||
((np)->offset + (np)->scale * noise2d_perlin( \
|
||||
(float)(x) / (np)->spread.X, \
|
||||
(float)(y) / (np)->spread.Y, \
|
||||
(s) + (np)->seed, (np)->octaves, (np)->persist))
|
||||
|
||||
#define NoisePerlin2DNoTxfm(np, x, y, s) \
|
||||
(noise2d_perlin( \
|
||||
(float)(x) / (np)->spread.X, \
|
||||
(float)(y) / (np)->spread.Y, \
|
||||
(s) + (np)->seed, (np)->octaves, (np)->persist))
|
||||
|
||||
#define NoisePerlin2DPosOffset(np, x, xoff, y, yoff, s) \
|
||||
((np)->offset + (np)->scale * noise2d_perlin( \
|
||||
(float)(xoff) + (float)(x) / (np)->spread.X, \
|
||||
(float)(yoff) + (float)(y) / (np)->spread.Y, \
|
||||
(s) + (np)->seed, (np)->octaves, (np)->persist))
|
||||
|
||||
#define NoisePerlin2DNoTxfmPosOffset(np, x, xoff, y, yoff, s) \
|
||||
(noise2d_perlin( \
|
||||
(float)(xoff) + (float)(x) / (np)->spread.X, \
|
||||
(float)(yoff) + (float)(y) / (np)->spread.Y, \
|
||||
(s) + (np)->seed, (np)->octaves, (np)->persist))
|
||||
|
||||
#define NoisePerlin3D(np, x, y, z, s) ((np)->offset + (np)->scale * \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue