VoxelEngine
 
Loading...
Searching...
No Matches
engine::Random Class Reference

#include <Random.h>

Static Public Member Functions

static uint32_t hash2D (int x, int y)
 
static uint32_t hash3D (int x, int y, int z)
 
static float noise2D (int x, int y)
 
static float noise3D (int x, int y, int z)
 
static float random2D (int x, int y)
 
static float random3D (int x, int y, int z)
 
static int randomRange2D (int x, int y, int min, int max)
 
static int randomRange3D (int x, int y, int z, int min, int max)
 
template<typename T >
static T random (T min=0.0, T max=1.0)
 

Detailed Description

Deterministic random number generator based on coordinates. Returns the same value for the same coordinates, regardless of access order.

Member Function Documentation

◆ noise2D()

float engine::Random::noise2D ( int  x,
int  y 
)
static
Returns
Random but same for the same coordinates, value between -1 and 1

◆ random()

template<typename T >
static T engine::Random::random ( min = 0.0,
max = 1.0 
)
inlinestatic
Returns
Value between [min and max)

◆ random2D()

float engine::Random::random2D ( int  x,
int  y 
)
static
Returns
Random but same for the same coordinates, value between [0 and 1)

◆ randomRange2D()

int engine::Random::randomRange2D ( int  x,
int  y,
int  min,
int  max 
)
static
Returns
Random but same for the same coordinates, value between [min and max)

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