Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
cInterpolNoise< T > Class Template Reference

#include <InterpolNoise.h>

Collaboration diagram for cInterpolNoise< T >:
Collaboration graph
[legend]

Public Member Functions

 cInterpolNoise (int a_Seed)
 
void Generate2D (NOISE_DATATYPE *a_Array, int a_SizeX, int a_SizeY, NOISE_DATATYPE a_StartX, NOISE_DATATYPE a_EndX, NOISE_DATATYPE a_StartY, NOISE_DATATYPE a_EndY) const
 Fills a 2D array with the values of the noise. More...
 
void Generate3D (NOISE_DATATYPE *a_Array, int a_SizeX, int a_SizeY, int a_SizeZ, NOISE_DATATYPE a_StartX, NOISE_DATATYPE a_EndX, NOISE_DATATYPE a_StartY, NOISE_DATATYPE a_EndY, NOISE_DATATYPE a_StartZ, NOISE_DATATYPE a_EndZ) const
 Fills a 3D array with the values of the noise. More...
 
void SetSeed (int a_Seed)
 Sets a new seed for the generators. More...
 

Protected Member Functions

void CalcFloorFrac (int a_Size, NOISE_DATATYPE a_Start, NOISE_DATATYPE a_End, int *a_Floor, NOISE_DATATYPE *a_Frac, int *a_Same, int &a_NumSame) const
 Calculates the integral and fractional parts along one axis. More...
 

Protected Attributes

cNoise m_Noise
 The noise used for the underlying value generation. More...
 

Static Private Attributes

static const int MAX_SIZE = 256
 Maximum size, for each direction, of the generated array. More...
 

Detailed Description

template<typename T>
class cInterpolNoise< T >

Definition at line 316 of file InterpolNoise.h.

Constructor & Destructor Documentation

◆ cInterpolNoise()

template<typename T >
cInterpolNoise< T >::cInterpolNoise ( int  a_Seed)
inline

Definition at line 322 of file InterpolNoise.h.

Member Function Documentation

◆ CalcFloorFrac()

template<typename T >
void cInterpolNoise< T >::CalcFloorFrac ( int  a_Size,
NOISE_DATATYPE  a_Start,
NOISE_DATATYPE  a_End,
int *  a_Floor,
NOISE_DATATYPE a_Frac,
int *  a_Same,
int &  a_NumSame 
) const
inlineprotected

Calculates the integral and fractional parts along one axis.

a_Floor will receive the integral parts (array of a_Size ints). a_Frac will receive the fractional parts (array of a_Size floats). a_Same will receive the counts of items that have the same integral parts (array of up to a_Size ints). a_NumSame will receive the count of a_Same elements (total count of different integral parts).

Definition at line 466 of file InterpolNoise.h.

◆ Generate2D()

template<typename T >
void cInterpolNoise< T >::Generate2D ( NOISE_DATATYPE a_Array,
int  a_SizeX,
int  a_SizeY,
NOISE_DATATYPE  a_StartX,
NOISE_DATATYPE  a_EndX,
NOISE_DATATYPE  a_StartY,
NOISE_DATATYPE  a_EndY 
) const
inline

Fills a 2D array with the values of the noise.

Parameters
a_ArrayArray to generate into [x + a_SizeX * y]
a_SizeYCount of the array, in each direction
a_EndXNoise-space coords of the array in the X direction
a_EndYNoise-space coords of the array in the Y direction

Definition at line 336 of file InterpolNoise.h.

◆ Generate3D()

template<typename T >
void cInterpolNoise< T >::Generate3D ( NOISE_DATATYPE a_Array,
int  a_SizeX,
int  a_SizeY,
int  a_SizeZ,
NOISE_DATATYPE  a_StartX,
NOISE_DATATYPE  a_EndX,
NOISE_DATATYPE  a_StartY,
NOISE_DATATYPE  a_EndY,
NOISE_DATATYPE  a_StartZ,
NOISE_DATATYPE  a_EndZ 
) const
inline

Fills a 3D array with the values of the noise.

Parameters
a_ArrayArray to generate into [x + a_SizeX * y + a_SizeX * a_SizeY * z]
a_SizeZCount of the array, in each direction
a_EndXNoise-space coords of the array in the X direction
a_EndYNoise-space coords of the array in the Y direction
a_EndZNoise-space coords of the array in the Z direction

Definition at line 386 of file InterpolNoise.h.

◆ SetSeed()

template<typename T >
void cInterpolNoise< T >::SetSeed ( int  a_Seed)
inline

Sets a new seed for the generators.

Relays the seed to the underlying noise.

Definition at line 329 of file InterpolNoise.h.

Member Data Documentation

◆ m_Noise

template<typename T >
cNoise cInterpolNoise< T >::m_Noise
protected

The noise used for the underlying value generation.

Definition at line 458 of file InterpolNoise.h.

◆ MAX_SIZE

template<typename T >
const int cInterpolNoise< T >::MAX_SIZE = 256
staticprivate

Maximum size, for each direction, of the generated array.

Definition at line 319 of file InterpolNoise.h.


The documentation for this class was generated from the following file: