Created
October 23, 2016 11:33
-
-
Save vasumahesh1/0d0529cca304c8cddefdc746aba25cf5 to your computer and use it in GitHub Desktop.
Header file for the Perlin Terrain Gen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
namespace Scaled | |
{ | |
class Generator | |
{ | |
static int originalPermutation[256]; | |
int perm[512]; | |
int mapHeight; | |
int mapWidth; | |
int octaves; | |
float persistence; | |
float amplitude; | |
float perlinGradientFunc(int hash, float x, float y); | |
float perlinLerp(float a, float b, float x); | |
float perlinFade(float t); | |
float generatePerlin(float x, float y); | |
public: | |
Generator(int height, int width); | |
float Perlin(float x, float y); | |
void SetNoiseOctaves(int oct); | |
void SetNoisePersistence(float pers); | |
void SetAmplitude(float amp); | |
float** GenerateMap(); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment