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

#include <InterpolNoise.h>

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

Public Member Functions

 cInterpolCell2D (const cNoise &a_Noise, NOISE_DATATYPE *a_Array, int a_SizeX, int a_SizeY, const NOISE_DATATYPE *a_FracX, const NOISE_DATATYPE *a_FracY)
 
void Generate (int a_FromX, int a_ToX, int a_FromY, int a_ToY)
 Generates part of the output noise array using the current m_WorkRnds[] values. More...
 
void InitWorkRnds (int a_FloorX, int a_FloorY)
 Initializes m_WorkRnds[] with the specified values of the noise at the specified integral coords. More...
 
void Move (int a_NewFloorX, int a_NewFloorY)
 Updates m_WorkRnds[] for the new integral coords. More...
 

Protected Types

typedef NOISE_DATATYPE Workspace[2][2]
 

Protected Attributes

NOISE_DATATYPEm_Array
 The output array to generate into. More...
 
int m_CurFloorX
 Coords of the currently calculated m_WorkRnds[]. More...
 
int m_CurFloorY
 
const NOISE_DATATYPEm_FracX
 Arrays holding the fractional values of the coords in each direction. More...
 
const NOISE_DATATYPEm_FracY
 
const cNoisem_Noise
 The noise used for generating the values at integral coords. More...
 
int m_SizeX
 Dimensions of the output array. More...
 
int m_SizeY
 
Workspacem_WorkRnds
 The current random values; points to either m_Workspace1 or m_Workspace2 (doublebuffering) More...
 
Workspace m_Workspace1
 Buffer 1 for workspace doublebuffering, used in Move() More...
 
Workspace m_Workspace2
 Buffer 2 for workspace doublebuffering, used in Move() More...
 

Detailed Description

template<typename T>
class cInterpolCell2D< T >

Definition at line 24 of file InterpolNoise.h.

Member Typedef Documentation

◆ Workspace

template<typename T >
typedef NOISE_DATATYPE cInterpolCell2D< T >::Workspace[2][2]
protected

Definition at line 116 of file InterpolNoise.h.

Constructor & Destructor Documentation

◆ cInterpolCell2D()

template<typename T >
cInterpolCell2D< T >::cInterpolCell2D ( const cNoise a_Noise,
NOISE_DATATYPE a_Array,
int  a_SizeX,
int  a_SizeY,
const NOISE_DATATYPE a_FracX,
const NOISE_DATATYPE a_FracY 
)
inline
Parameters
a_NoiseNoise to use for generating the random values
a_ArrayArray to generate into [x + a_SizeX * y]
a_SizeYCount of the array, in each direction
a_FracXPointer to the array that stores the X fractional values
a_FracYPointer to the attay that stores the Y fractional values

Definition at line 27 of file InterpolNoise.h.

Member Function Documentation

◆ Generate()

template<typename T >
void cInterpolCell2D< T >::Generate ( int  a_FromX,
int  a_ToX,
int  a_FromY,
int  a_ToY 
)
inline

Generates part of the output noise array using the current m_WorkRnds[] values.

Definition at line 48 of file InterpolNoise.h.

◆ InitWorkRnds()

template<typename T >
void cInterpolCell2D< T >::InitWorkRnds ( int  a_FloorX,
int  a_FloorY 
)
inline

Initializes m_WorkRnds[] with the specified values of the noise at the specified integral coords.

Definition at line 69 of file InterpolNoise.h.

◆ Move()

template<typename T >
void cInterpolCell2D< T >::Move ( int  a_NewFloorX,
int  a_NewFloorY 
)
inline

Updates m_WorkRnds[] for the new integral coords.

Definition at line 81 of file InterpolNoise.h.

Member Data Documentation

◆ m_Array

template<typename T >
NOISE_DATATYPE* cInterpolCell2D< T >::m_Array
protected

The output array to generate into.

Definition at line 134 of file InterpolNoise.h.

◆ m_CurFloorX

template<typename T >
int cInterpolCell2D< T >::m_CurFloorX
protected

Coords of the currently calculated m_WorkRnds[].

Definition at line 131 of file InterpolNoise.h.

◆ m_CurFloorY

template<typename T >
int cInterpolCell2D< T >::m_CurFloorY
protected

Definition at line 131 of file InterpolNoise.h.

◆ m_FracX

template<typename T >
const NOISE_DATATYPE* cInterpolCell2D< T >::m_FracX
protected

Arrays holding the fractional values of the coords in each direction.

Definition at line 140 of file InterpolNoise.h.

◆ m_FracY

template<typename T >
const NOISE_DATATYPE* cInterpolCell2D< T >::m_FracY
protected

Definition at line 141 of file InterpolNoise.h.

◆ m_Noise

template<typename T >
const cNoise& cInterpolCell2D< T >::m_Noise
protected

The noise used for generating the values at integral coords.

Definition at line 119 of file InterpolNoise.h.

◆ m_SizeX

template<typename T >
int cInterpolCell2D< T >::m_SizeX
protected

Dimensions of the output array.

Definition at line 137 of file InterpolNoise.h.

◆ m_SizeY

template<typename T >
int cInterpolCell2D< T >::m_SizeY
protected

Definition at line 137 of file InterpolNoise.h.

◆ m_WorkRnds

template<typename T >
Workspace* cInterpolCell2D< T >::m_WorkRnds
protected

The current random values; points to either m_Workspace1 or m_Workspace2 (doublebuffering)

Definition at line 122 of file InterpolNoise.h.

◆ m_Workspace1

template<typename T >
Workspace cInterpolCell2D< T >::m_Workspace1
protected

Buffer 1 for workspace doublebuffering, used in Move()

Definition at line 125 of file InterpolNoise.h.

◆ m_Workspace2

template<typename T >
Workspace cInterpolCell2D< T >::m_Workspace2
protected

Buffer 2 for workspace doublebuffering, used in Move()

Definition at line 128 of file InterpolNoise.h.


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