Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Typedefs | Functions
Noise.h File Reference
#include "../Vector3.h"
#include "OctavedNoise.h"
#include "RidgedNoise.h"
Include dependency graph for Noise.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cCubicNoise
 
class  cImprovedNoise
 Improved noise, as described by Ken Perlin: https://mrl.nyu.edu/~perlin/paper445.pdf Implementation adapted from Perlin's Java implementation: https://mrl.nyu.edu/~perlin/noise/. More...
 
class  cNoise
 

Typedefs

typedef cOctavedNoise< cCubicNoisecPerlinNoise
 
typedef cOctavedNoise< cRidgedNoise< cCubicNoise > > cRidgedMultiNoise
 
typedef float NOISE_DATATYPE
 The datatype used by all the noise generators. More...
 

Functions

NOISE_DATATYPE ClampedLerp (NOISE_DATATYPE a_Val1, NOISE_DATATYPE a_Val2, NOISE_DATATYPE a_Ratio)
 Linearly interpolates between two values, clamping the ratio to [0, 1] first. More...
 
void Debug2DNoise (const NOISE_DATATYPE *a_Array, size_t a_SizeX, size_t a_SizeY, const AString &a_FileNameBase, NOISE_DATATYPE a_Coeff=32)
 Exports the noise array into a file. More...
 
void Debug3DNoise (const NOISE_DATATYPE *a_Array, size_t a_SizeX, size_t a_SizeY, size_t a_SizeZ, const AString &a_FileNameBase, NOISE_DATATYPE a_Coeff=32)
 Exports the noise array into a set of files, ordered by XY and XZ. More...
 
NOISE_DATATYPE Lerp (NOISE_DATATYPE a_Val1, NOISE_DATATYPE a_Val2, NOISE_DATATYPE a_Ratio)
 Linearly interpolates between two values. More...
 

Typedef Documentation

◆ cPerlinNoise

Definition at line 176 of file Noise.h.

◆ cRidgedMultiNoise

Definition at line 177 of file Noise.h.

◆ NOISE_DATATYPE

typedef float NOISE_DATATYPE

The datatype used by all the noise generators.

Definition at line 9 of file Noise.h.

Function Documentation

◆ ClampedLerp()

NOISE_DATATYPE ClampedLerp ( NOISE_DATATYPE  a_Val1,
NOISE_DATATYPE  a_Val2,
NOISE_DATATYPE  a_Ratio 
)
inline

Linearly interpolates between two values, clamping the ratio to [0, 1] first.

Definition at line 334 of file Noise.h.

◆ Debug2DNoise()

void Debug2DNoise ( const NOISE_DATATYPE a_Array,
size_t  a_SizeX,
size_t  a_SizeY,
const AString a_FileNameBase,
NOISE_DATATYPE  a_Coeff = 32 
)

Exports the noise array into a file.

a_Coeff specifies the value that each array value is multiplied by before being converted into a byte.

Definition at line 168 of file Noise.cpp.

◆ Debug3DNoise()

void Debug3DNoise ( const NOISE_DATATYPE a_Array,
size_t  a_SizeX,
size_t  a_SizeY,
size_t  a_SizeZ,
const AString a_FileNameBase,
NOISE_DATATYPE  a_Coeff = 32 
)

Exports the noise array into a set of files, ordered by XY and XZ.

a_Coeff specifies the value that each array value is multiplied by before being converted into a byte.

Definition at line 115 of file Noise.cpp.

◆ Lerp()

NOISE_DATATYPE Lerp ( NOISE_DATATYPE  a_Val1,
NOISE_DATATYPE  a_Val2,
NOISE_DATATYPE  a_Ratio 
)
inline

Linearly interpolates between two values.

Assumes that a_Ratio is in range [0, 1].

Definition at line 324 of file Noise.h.