playername = "singleplayer"
^ Playername is optional, if specified spawns particle only on the player's client
}
+
+NoiseParams definition (PerlinNoiseMap)
+{
+ offset = 0,
+ scale = 0,
+ spread = 0,
+ seed = 0,
+ octaves = 0,
+ ^ A higher value will result in more details, this means more operations
+ persist = 0,
+ eased = false
+ ^ Whether it should create curves in 3D perlin maps
+}
int seed;
int octaves;
float persist;
+ bool eased;
NoiseParams() {}
NoiseParams(float offset_, float scale_, v3f spread_,
- int seed_, int octaves_, float persist_)
+ int seed_, int octaves_, float persist_, bool eased_=false)
{
offset = offset_;
scale = scale_;
seed = seed_;
octaves = octaves_;
persist = persist_;
+ eased = eased_;
}
};
np->persist = getfloatfield_default(L, index, "persist", 0.0);
np->seed = getintfield_default(L, index, "seed", 0);
np->octaves = getintfield_default(L, index, "octaves", 0);
+ np->eased = getboolfield_default(L, index, "eased", false);
lua_getfield(L, index, "spread");
np->spread = read_v3f(L, -1);
v3f p = read_v3f(L, 2);
Noise *n = o->noise;
- n->perlinMap3D(p.X, p.Y, p.Z);
+ n->perlinMap3D(p.X, p.Y, p.Z, n->np->eased);
lua_newtable(L);
for (int z = 0; z != n->sz; z++) {
v3f p = read_v3f(L, 2);
Noise *n = o->noise;
- n->perlinMap3D(p.X, p.Y, p.Z);
+ n->perlinMap3D(p.X, p.Y, p.Z, n->np->eased);
int maplen = n->sx * n->sy * n->sz;