Luanti 5.16.0-dev
Loading...
Searching...
No Matches
Noise Class Reference

#include <noise.h>

Collaboration diagram for Noise:

Public Member Functions

 Noise (const NoiseParams *np, s32 seed, u32 sx, u32 sy, u32 sz=1)
 ~Noise ()
void setSize (u32 sx, u32 sy, u32 sz=1)
void setSpreadFactor (v3f spread)
void setOctaves (int octaves)
void valueMap2D (float x, float y, float step_x, float step_y, s32 seed)
void valueMap3D (float x, float y, float z, float step_x, float step_y, float step_z, s32 seed)
float * noiseMap2D (float x, float y, float *persistence_map=NULL)
float * noiseMap3D (float x, float y, float z, float *persistence_map=NULL)
float * noiseMap2D_PO (float x, float xoff, float y, float yoff, float *persistence_map=NULL)
float * noiseMap3D_PO (float x, float xoff, float y, float yoff, float z, float zoff, float *persistence_map=NULL)

Public Attributes

NoiseParams np
s32 seed
u32 sx
u32 sy
u32 sz
float * noise_buf = nullptr
float * value_buf = nullptr
float * persist_buf = nullptr
float * result = nullptr

Private Member Functions

void allocBuffers ()
void resizeNoiseBuf (bool is3d)
void updateResults (float g, float *gmap, const float *persistence_map, size_t bufsize)

Constructor & Destructor Documentation

◆ Noise()

Noise::Noise ( const NoiseParams * np,
s32 seed,
u32 sx,
u32 sy,
u32 sz = 1 )

References allocBuffers(), np, seed, sx, sy, and sz.

Here is the call graph for this function:

◆ ~Noise()

Noise::~Noise ( )

References noise_buf, persist_buf, result, and value_buf.

Member Function Documentation

◆ allocBuffers()

void Noise::allocBuffers ( )
private

References noise_buf, persist_buf, resizeNoiseBuf(), result, sx, sy, sz, and value_buf.

Referenced by Noise(), and setSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ noiseMap2D()

float * Noise::noiseMap2D ( float x,
float y,
float * persistence_map = NULL )

References np, persist_buf, result, seed, sx, sy, updateResults(), valueMap2D(), x, and y.

Referenced by LuaValueNoiseMap::l_calc_2d_map(), LuaValueNoiseMap::l_get_2d_map(), LuaValueNoiseMap::l_get_2d_map_flat(), noiseMap2D_PO(), and TestNoise::testNoise2dBulk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ noiseMap2D_PO()

float * Noise::noiseMap2D_PO ( float x,
float xoff,
float y,
float yoff,
float * persistence_map = NULL )
inline

References noiseMap2D(), np, x, and y.

Here is the call graph for this function:

◆ noiseMap3D()

float * Noise::noiseMap3D ( float x,
float y,
float z,
float * persistence_map = NULL )

References np, persist_buf, result, seed, sx, sy, sz, updateResults(), valueMap3D(), x, y, and z.

Referenced by LuaValueNoiseMap::l_calc_3d_map(), LuaValueNoiseMap::l_get_3d_map(), LuaValueNoiseMap::l_get_3d_map_flat(), noiseMap3D_PO(), TestNoise::testNoise3dBulk(), and TestNoise::testNoiseInvalidParams().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ noiseMap3D_PO()

float * Noise::noiseMap3D_PO ( float x,
float xoff,
float y,
float yoff,
float z,
float zoff,
float * persistence_map = NULL )
inline

References noiseMap3D(), np, x, y, and z.

Here is the call graph for this function:

◆ resizeNoiseBuf()

void Noise::resizeNoiseBuf ( bool is3d)
private

References errorstream, noise_buf, np, sx, sy, and sz.

Referenced by allocBuffers(), setOctaves(), and setSpreadFactor().

Here is the caller graph for this function:

◆ setOctaves()

void Noise::setOctaves ( int octaves)

References np, resizeNoiseBuf(), and sz.

Here is the call graph for this function:

◆ setSize()

void Noise::setSize ( u32 sx,
u32 sy,
u32 sz = 1 )

References allocBuffers(), sx, sy, and sz.

Here is the call graph for this function:

◆ setSpreadFactor()

void Noise::setSpreadFactor ( v3f spread)

References np, resizeNoiseBuf(), and sz.

Here is the call graph for this function:

◆ updateResults()

void Noise::updateResults ( float g,
float * gmap,
const float * persistence_map,
size_t bufsize )
private

References NOISE_FLAG_ABSVALUE, np, result, and value_buf.

Referenced by noiseMap2D(), and noiseMap3D().

Here is the caller graph for this function:

◆ valueMap2D()

void Noise::valueMap2D ( float x,
float y,
float step_x,
float step_y,
s32 seed )

References biLinearInterpolation(), idx, noise2d(), noise_buf, NOISE_FLAG_DEFAULTS, NOISE_FLAG_EASED, np, seed, sx, sy, value_buf, x, and y.

Referenced by noiseMap2D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueMap3D()

void Noise::valueMap3D ( float x,
float y,
float z,
float step_x,
float step_y,
float step_z,
s32 seed )

References idx, noise3d(), noise_buf, NOISE_FLAG_EASED, np, seed, sx, sy, sz, triLinearInterpolation(), value_buf, x, y, and z.

Referenced by noiseMap3D().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ noise_buf

float* Noise::noise_buf = nullptr

◆ np

◆ persist_buf

float* Noise::persist_buf = nullptr

◆ result

◆ seed

◆ sx

◆ sy

◆ sz

◆ value_buf

float* Noise::value_buf = nullptr

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