diff options
author | Mattes D <github@xoft.cz> | 2014-11-18 09:49:53 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-11-18 09:49:53 +0100 |
commit | f683872f5423c184d56bc229c7de44b2384c4787 (patch) | |
tree | b9676b82ee033e88bc98e0dd82f8a1d77c4209fa /src/Noise.h | |
parent | OctavedNoise: linux compilation fixes. (diff) | |
download | cuberite-f683872f5423c184d56bc229c7de44b2384c4787.tar cuberite-f683872f5423c184d56bc229c7de44b2384c4787.tar.gz cuberite-f683872f5423c184d56bc229c7de44b2384c4787.tar.bz2 cuberite-f683872f5423c184d56bc229c7de44b2384c4787.tar.lz cuberite-f683872f5423c184d56bc229c7de44b2384c4787.tar.xz cuberite-f683872f5423c184d56bc229c7de44b2384c4787.tar.zst cuberite-f683872f5423c184d56bc229c7de44b2384c4787.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Noise.h | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/src/Noise.h b/src/Noise.h index 8b9ee2f3b..e616155d5 100644 --- a/src/Noise.h +++ b/src/Noise.h @@ -11,6 +11,7 @@ typedef float NOISE_DATATYPE; #include "OctavedNoise.h" +#include "RidgedNoise.h" @@ -186,70 +187,7 @@ protected: typedef cOctavedNoise<cCubicNoise> cPerlinNoise; - - - - - -class cRidgedMultiNoise -{ -public: - cRidgedMultiNoise(void); - cRidgedMultiNoise(int a_Seed); - - - void SetSeed(int a_Seed); - - void AddOctave(NOISE_DATATYPE a_Frequency, NOISE_DATATYPE a_Amplitude); - - void Generate1D( - NOISE_DATATYPE * a_Array, ///< Array to generate into - int a_SizeX, ///< Count of the array - NOISE_DATATYPE a_StartX, NOISE_DATATYPE a_EndX, ///< Noise-space coords of the array - NOISE_DATATYPE * a_Workspace = nullptr ///< Workspace that this function can use and trash - ) const; - - - void Generate2D( - NOISE_DATATYPE * a_Array, ///< Array to generate into [x + a_SizeX * y] - int a_SizeX, int a_SizeY, ///< Count of the array, in each direction - NOISE_DATATYPE a_StartX, NOISE_DATATYPE a_EndX, ///< Noise-space coords of the array in the X direction - NOISE_DATATYPE a_StartY, NOISE_DATATYPE a_EndY, ///< Noise-space coords of the array in the Y direction - NOISE_DATATYPE * a_Workspace = nullptr ///< Workspace that this function can use and trash - ) const; - - - void Generate3D( - NOISE_DATATYPE * a_Array, ///< Array to generate into [x + a_SizeX * y + a_SizeX * a_SizeY * z] - int a_SizeX, int a_SizeY, int a_SizeZ, ///< Count of the array, in each direction - NOISE_DATATYPE a_StartX, NOISE_DATATYPE a_EndX, ///< Noise-space coords of the array in the X direction - NOISE_DATATYPE a_StartY, NOISE_DATATYPE a_EndY, ///< Noise-space coords of the array in the Y direction - NOISE_DATATYPE a_StartZ, NOISE_DATATYPE a_EndZ, ///< Noise-space coords of the array in the Z direction - NOISE_DATATYPE * a_Workspace = nullptr ///< Workspace that this function can use and trash - ) const; - -protected: - class cOctave - { - public: - cCubicNoise m_Noise; - - NOISE_DATATYPE m_Frequency; // Coord multiplier - NOISE_DATATYPE m_Amplitude; // Value multiplier - - cOctave(int a_Seed, NOISE_DATATYPE a_Frequency, NOISE_DATATYPE a_Amplitude) : - m_Noise(a_Seed), - m_Frequency(a_Frequency), - m_Amplitude(a_Amplitude) - { - } - } ; - - typedef std::vector<cOctave> cOctaves; - - int m_Seed; - cOctaves m_Octaves; -} ; +typedef cOctavedNoise<cRidgedNoise<cCubicNoise>> cRidgedMultiNoise; |