]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapgen_fractal.h
Set acceleration only once in falling node
[minetest.git] / src / mapgen_fractal.h
index 71729cbed6c170f73970727710a4671520053002..ffb2acfb9ab40530712c1deb94988f7b4ee024ce 100644 (file)
@@ -1,7 +1,10 @@
 /*
 Minetest
-Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
-Additional development and fractal code by paramat
+Copyright (C) 2010-2015 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
+Copyright (C) 2010-2015 paramat, Matt Gregory
+
+Fractal formulas from http://www.bugman123.com/Hypercomplex/index.html
+by Paul Nylander, and from http://www.fractalforums.com, thank you.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -23,8 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "mapgen.h"
 
-/////////////////// Mapgen Fractal flags
-#define MGFRACTAL_JULIA 0x01
+#define MGFRACTAL_LARGE_CAVE_DEPTH -33
 
 class BiomeManager;
 
@@ -34,19 +36,19 @@ extern FlagDesc flagdesc_mapgen_fractal[];
 struct MapgenFractalParams : public MapgenSpecificParams {
        u32 spflags;
 
+       u16 fractal;
        u16 iterations;
-       float scale_x;
-       float scale_y;
-       float scale_z;
-       float offset_x;
-       float offset_y;
-       float offset_z;
+       v3f scale;
+       v3f offset;
        float slice_w;
+
        float julia_x;
        float julia_y;
        float julia_z;
        float julia_w;
 
+       NoiseParams np_seabed;
+       NoiseParams np_filler_depth;
        NoiseParams np_cave1;
        NoiseParams np_cave2;
 
@@ -64,26 +66,29 @@ class MapgenFractal : public Mapgen {
 
        int ystride;
        int zstride;
-       u32 spflags;
+       u16 formula;
+       bool julia;
 
        v3s16 node_min;
        v3s16 node_max;
        v3s16 full_node_min;
        v3s16 full_node_max;
 
+       u32 spflags;
+
+       u16 fractal;
        u16 iterations;
-       float scale_x;
-       float scale_y;
-       float scale_z;
-       float offset_x;
-       float offset_y;
-       float offset_z;
+       v3f scale;
+       v3f offset;
        float slice_w;
+
        float julia_x;
        float julia_y;
        float julia_z;
        float julia_w;
 
+       Noise *noise_seabed;
+       Noise *noise_filler_depth;
        Noise *noise_cave1;
        Noise *noise_cave2;
 
@@ -109,9 +114,9 @@ class MapgenFractal : public Mapgen {
        ~MapgenFractal();
 
        virtual void makeChunk(BlockMakeData *data);
-       int getGroundLevelAtPoint(v2s16 p);
+       int getSpawnLevelAtPoint(v2s16 p);
        void calculateNoise();
-       bool getTerrainAtPoint(s16 x, s16 y, s16 z);
+       bool getFractalAtPoint(s16 x, s16 y, s16 z);
        s16 generateTerrain();
        MgStoneType generateBiomes(float *heat_map, float *humidity_map);
        void dustTopNodes();