mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Finish and clean up mapgen configuration
This commit is contained in:
parent
45cf32afc5
commit
631a835e07
13 changed files with 395 additions and 341 deletions
10
src/noise.h
10
src/noise.h
|
@ -70,6 +70,10 @@ struct NoiseParams {
|
|||
};
|
||||
|
||||
|
||||
// Convenience macros for getting/setting NoiseParams in Settings
|
||||
#define getNoiseParams(x) getStruct<NoiseParams>((x), "f,f,v3,s32,s32,f")
|
||||
#define setNoiseParams(x, y) setStruct((x), "f,f,v3,s32,s32,f", (y))
|
||||
|
||||
class Noise {
|
||||
public:
|
||||
NoiseParams *np;
|
||||
|
@ -129,8 +133,12 @@ inline float easeCurve(float t) {
|
|||
}
|
||||
|
||||
#define NoisePerlin2D(np, x, y, s) ((np)->offset + (np)->scale * \
|
||||
noise2d_perlin((float)(x) * (np)->spread.X, (float)(y) * (np)->spread.Y, \
|
||||
noise2d_perlin((float)(x) / (np)->spread.X, (float)(y) / (np)->spread.Y, \
|
||||
(s) + (np)->seed, (np)->octaves, (np)->persist))
|
||||
|
||||
#define NoisePerlin3D(np, x, y, z, s) ((np)->offset + (np)->scale * \
|
||||
noise2d_perlin((float)(x) / (np)->spread.X, (float)(y) / (np)->spread.Y, \
|
||||
(float)(z) / (np)->spread.Z, (s) + (np)->seed, (np)->octaves, (np)->persist))
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue