1 /**************************************************************************/ 2 /* Copyright 2009 Tim Day */ 3 /* */ 4 /* This file is part of Fracplanet */ 5 /* */ 6 /* Fracplanet is free software: you can redistribute it and/or modify */ 7 /* it under the terms of the GNU General Public License as published by */ 8 /* the Free Software Foundation, either version 3 of the License, or */ 9 /* (at your option) any later version. */ 10 /* */ 11 /* Fracplanet is distributed in the hope that it will be useful, */ 12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 14 /* GNU General Public License for more details. */ 15 /* */ 16 /* You should have received a copy of the GNU General Public License */ 17 /* along with Fracplanet. If not, see <http://www.gnu.org/licenses/>. */ 18 /**************************************************************************/ 19 20 /*! \file 21 \brief Interface for class ParametersTerrain. 22 */ 23 24 #ifndef _parameters_terrain_h_ 25 #define _parameters_terrain_h_ 26 27 #include "common.h" 28 #include "parameters_noise.h" 29 #include "parameters_object.h" 30 #include "rgb.h" 31 #include "xyz.h" 32 33 //! This class aggregates the controllable parameters for all things related to terrain generation. 34 /*! \todo Add these to ParametersTerrain (and ControlTerrain): float treeline; float beachline; 35 */ 36 class ParametersTerrain : public ParametersObject 37 { 38 public: 39 40 //! Constructor sets up some hopefully sensible defaults. 41 ParametersTerrain(); 42 43 //! Destructor 44 ~ParametersTerrain(); 45 46 //! Numer of subdivisions (at the top level) which will be unperturbed 47 uint subdivisions_unperturbed; 48 49 //! Maximum size of perturbations (z in vertical direction, x & y horizontally). 50 XYZ variation; 51 52 ParametersNoise noise; 53 54 //! Initial height of unsubdivided, unperturbed terrain, expressed as a proportion of variation.z 55 float base_height; 56 57 //! Power law applied to terrain heights. 58 /*! When >1, flattens low areas. When <1, flattens highland areas and creates gorges. 59 */ 60 float power_law; 61 62 //! Normalised height of snowline at the equator. 63 float snowline_equator; 64 65 //! Normalised height of snowline at the pole. 66 float snowline_pole; 67 68 //! Power law for snowline. 69 float snowline_power_law; 70 71 //! Supresses snow on slopes. 72 float snowline_slope_effect; 73 74 //! When positive, rivers become glaciers. When negative, rivers remain blue. 75 float snowline_glacier_effect; 76 77 //! Number of rivers to generate. 78 uint rivers; 79 80 //! Random seed for river generation. 81 uint rivers_seed; 82 83 //! Limit on lake size as a proportion of available surface. 84 /*! When lakes (produced during the river-growing step) cover this fraction of the available terrain they become seas and no-longer need to find a drain. 85 */ 86 float lake_becomes_sea; 87 88 //! Amount of emissive colour for oceans and rivers. 89 float oceans_and_rivers_emissive; 90 91 //@{ 92 //! Colour for a terrain type. 93 FloatRGBA colour_ocean; 94 FloatRGBA colour_river; 95 FloatRGBA colour_shoreline; 96 FloatRGBA colour_low; 97 FloatRGBA colour_high; 98 FloatRGBA colour_snow; 99 //@} 100 }; 101 102 #endif 103