/*
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
#include "mapgen.h"
-/////////////////// Mapgen Fractal flags
-#define MGFRACTAL_JULIA 0x01
+#define MGFRACTAL_LARGE_CAVE_DEPTH -33
class BiomeManager;
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;
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;
~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();