Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
cCubicNoise Class Reference

#include <Noise.h>

Collaboration diagram for cCubicNoise:
Collaboration graph
[legend]

Public Member Functions

 cCubicNoise (int a_Seed)
 Creates a new instance with the specified seed. More...
 
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...
 

Static Public Attributes

static const int MAX_SIZE = 512
 Maximum size of each dimension of the query arrays. 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
 Noise used for integral random values. More...
 

Detailed Description

Definition at line 67 of file Noise.h.

Constructor & Destructor Documentation

◆ cCubicNoise()

cCubicNoise::cCubicNoise ( int  a_Seed)

Creates a new instance with the specified seed.

Definition at line 697 of file Noise.cpp.

Member Function Documentation

◆ CalcFloorFrac()

void cCubicNoise::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
protected

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 827 of file Noise.cpp.

◆ Generate2D()

void cCubicNoise::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.

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 706 of file Noise.cpp.

◆ Generate3D()

void cCubicNoise::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.

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 758 of file Noise.cpp.

Member Data Documentation

◆ m_Noise

cNoise cCubicNoise::m_Noise
protected

Noise used for integral random values.

Definition at line 99 of file Noise.h.

◆ MAX_SIZE

const int cCubicNoise::MAX_SIZE = 512
static

Maximum size of each dimension of the query arrays.

Definition at line 71 of file Noise.h.


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