Amortized Noise Terrain Generator
A Program to Generate Terrain from Amortized Noise with Exponentially Distributed Gradient Magnitude
TerrainGenerator.h
Go to the documentation of this file.
1
3
4// Copyright Ian Parberry, September 2013.
5//
6// This file is made available under the GNU All-Permissive License.
7//
8// Copying and distribution of this file, with or without modification,
9// are permitted in any medium without royalty provided the copyright
10// notice and this notice are preserved. This file is offered as-is,
11// without any warranty.
12//
13// Created by Ian Parberry, May 2014.
14// Last updated May 30, 2014.
15
16#pragma once
17
19
24
26 protected:
27 unsigned int seed1;
28 unsigned int seed2;
29 float omega;
30
31 unsigned int h(const unsigned int x, const unsigned int y, unsigned int seed);
32 void initEdgeTables(const int x, const int y, const int n);
33
34 public:
35 CTerrainGenerator(const unsigned int n, const unsigned int s, float tail);
36}; //CTerrainGenerator
Header file for the 2D amortized noise class CInfiniteAmortizedNoise2D.
The amortized 2D noise class.
Definition: InfiniteAmortizedNoise2D.h:27
unsigned int seed
Hash seed.
Definition: InfiniteAmortizedNoise2D.h:38
The terrain generator class.
Definition: TerrainGenerator.h:25
unsigned int seed2
Hash seed for tail of gradient magnitude distribution.
Definition: TerrainGenerator.h:28
void initEdgeTables(const int x, const int y, const int n)
Initialize the amortized noise tables.
Definition: TerrainGenerator.cpp:57
float omega
Tail height multiplier.
Definition: TerrainGenerator.h:29
unsigned int seed1
Hash seed for gradient magnitude.
Definition: TerrainGenerator.h:27
CTerrainGenerator(const unsigned int n, const unsigned int s, float tail)
Constructor.
Definition: TerrainGenerator.cpp:31
unsigned int h(const unsigned int x, const unsigned int y, unsigned int seed)
2D hash function.
Definition: TerrainGenerator.cpp:44