nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
noise.h
Go to the documentation of this file.
1#ifndef NANOMMO_TERRAIN_NOISE_H_
2#define NANOMMO_TERRAIN_NOISE_H_
3
4#include <cstdint>
5
6namespace nanommo {
7
8/// A number for each point of a grid, which looks random, but is the same
9/// for the same seed and point, on any machine.
10uint32_t Hash(uint32_t seed, int32_t x, int32_t z);
11
12/// Value noise: from -1 to 1, random at whole numbers, and smooth between them.
13float Noise(uint32_t seed, float x, float z);
14
15/// Octaves of noise, each twice as fine and half as strong as the one before.
16/// From -1 to 1.
17float Fractal(uint32_t seed, float x, float z, int octaves);
18
19} // namespace nanommo
20
21#endif // NANOMMO_TERRAIN_NOISE_H_
Definition chat.cc:9
float Fractal(uint32_t seed, float x, float z, int octaves)
Definition noise.cc:47
uint32_t Hash(uint32_t seed, int32_t x, int32_t z)
Definition noise.cc:22
float Noise(uint32_t seed, float x, float z)
Value noise: from -1 to 1, random at whole numbers, and smooth between them.
Definition noise.cc:34