Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Public Member Functions | Protected Types | Protected Attributes | List of all members
cOctavedNoise< N > Class Template Reference

#include <OctavedNoise.h>

Classes

class  cOctave
 Stores information and state for one octave of the noise. More...
 

Public Member Functions

void AddOctave (NOISE_DATATYPE a_Frequency, NOISE_DATATYPE a_Amplitude)
 Adds a new octave to the list of octaves that compose this noise. More...
 
 cOctavedNoise (int a_Seed=0)
 
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, NOISE_DATATYPE *a_Workspace=nullptr) 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, NOISE_DATATYPE *a_Workspace=nullptr) 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 Types

typedef std::vector< cOctavecOctaves
 

Protected Attributes

cOctaves m_Octaves
 The octaves that compose this noise. More...
 
int m_Seed
 The seed used by the underlying generators. More...
 

Detailed Description

template<typename N>
class cOctavedNoise< N >

Definition at line 17 of file OctavedNoise.h.

Member Typedef Documentation

◆ cOctaves

template<typename N >
typedef std::vector<cOctave> cOctavedNoise< N >::cOctaves
protected

Definition at line 184 of file OctavedNoise.h.

Constructor & Destructor Documentation

◆ cOctavedNoise()

template<typename N >
cOctavedNoise< N >::cOctavedNoise ( int  a_Seed = 0)
inline

Definition at line 20 of file OctavedNoise.h.

Member Function Documentation

◆ AddOctave()

template<typename N >
void cOctavedNoise< N >::AddOctave ( NOISE_DATATYPE  a_Frequency,
NOISE_DATATYPE  a_Amplitude 
)
inline

Adds a new octave to the list of octaves that compose this noise.

Definition at line 38 of file OctavedNoise.h.

◆ Generate2D()

template<typename N >
void cOctavedNoise< N >::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,
NOISE_DATATYPE a_Workspace = nullptr 
) 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
a_WorkspaceWorkspace that this function can use and trash.

Definition at line 45 of file OctavedNoise.h.

◆ Generate3D()

template<typename N >
void cOctavedNoise< N >::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,
NOISE_DATATYPE a_Workspace = nullptr 
) 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
a_WorkspaceWorkspace that this function can use and trash, same size as a_Array

Definition at line 104 of file OctavedNoise.h.

◆ SetSeed()

template<typename N >
void cOctavedNoise< N >::SetSeed ( int  a_Seed)
inline

Sets a new seed for the generators.

Relays the seed to all underlying octaves.

Definition at line 27 of file OctavedNoise.h.

Member Data Documentation

◆ m_Octaves

template<typename N >
cOctaves cOctavedNoise< N >::m_Octaves
protected

The octaves that compose this noise.

Definition at line 191 of file OctavedNoise.h.

◆ m_Seed

template<typename N >
int cOctavedNoise< N >::m_Seed
protected

The seed used by the underlying generators.

Definition at line 188 of file OctavedNoise.h.


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