summaryrefslogtreecommitdiff
path: root/src/noise.h
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2013-01-07 16:42:00 -0500
committerPerttu Ahola <celeron55@gmail.com>2013-01-21 21:41:37 +0200
commit1cd8351054c6f0b120e603e0e25b85da385f185a (patch)
tree59bf2dcc5375e594552273e605d59d738d2bb599 /src/noise.h
parent631a835e0782a2696762e3d55f75616f5a063394 (diff)
downloadminetest-1cd8351054c6f0b120e603e0e25b85da385f185a.tar.gz
minetest-1cd8351054c6f0b120e603e0e25b85da385f185a.tar.bz2
minetest-1cd8351054c6f0b120e603e0e25b85da385f185a.zip
Fix MapgenV6::getGroundLevelAtPoint()
Diffstat (limited to 'src/noise.h')
-rw-r--r--src/noise.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/noise.h b/src/noise.h
index 9fb6d48a1..e725b4e47 100644
--- a/src/noise.h
+++ b/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 * \