From 8f2920a090dd9000aecb04c901311ffe195ea39b Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 11 May 2013 21:09:39 +0000 Subject: Converted the Noise3D generator to optimized noise and lerp git-svn-id: http://mc-server.googlecode.com/svn/trunk@1471 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/Noise3DGenerator.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/Generating/Noise3DGenerator.h') diff --git a/source/Generating/Noise3DGenerator.h b/source/Generating/Noise3DGenerator.h index 071b19019..57cf024f8 100644 --- a/source/Generating/Noise3DGenerator.h +++ b/source/Generating/Noise3DGenerator.h @@ -29,9 +29,13 @@ public: virtual void DoGenerate(int a_ChunkX, int a_ChunkZ, cChunkDesc & a_ChunkDesc) override; protected: - cNoise m_Noise1; - cNoise m_Noise2; - cNoise m_Noise3; + // Linear interpolation dimensions: + static const int DIMX = 5; + static const int DIMY = 65; + static const int DIMZ = 5; + + cPerlinNoise m_Perlin; // The base 3D noise source for the actual composition + cCubicNoise m_Cubic; // The noise used for heightmap directing int m_SeaLevel; NOISE_DATATYPE m_HeightAmplification; @@ -41,7 +45,7 @@ protected: NOISE_DATATYPE m_FrequencyZ; NOISE_DATATYPE m_AirThreshold; - /// Generates the 3D noise array used for terrain generation + /// Generates the 3D noise array used for terrain generation; a_Noise is of ChunkData-size void GenerateNoiseArray(int a_ChunkX, int a_ChunkZ, NOISE_DATATYPE * a_Noise); /// Updates heightmap based on the chunk's contents -- cgit v1.2.3