32#if defined(RANDOM_MIN)
35#if defined(RANDOM_MAX)
59 m_next =
static_cast<u32
>(
m_next) * 1103515245U + 12345U;
64 inline s32
range(s32 min, s32 max)
74 if (
static_cast<u32
>(max - min) > (
RANDOM_RANGE + 1) / 5)
77 return (
next() % (max - min + 1)) + min;
95 PcgRandom(u64 state=0x853c49e6748fea9bULL, u64 seq=0xda3e39cb94b95bdbULL);
96 void seed(u64 state, u64 seq=0xda3e39cb94b95bdbULL);
99 s32
range(s32 min, s32 max);
100 void bytes(
void *out,
size_t len);
111#define NOISE_FLAG_DEFAULTS 0x01
112#define NOISE_FLAG_EASED 0x02
113#define NOISE_FLAG_ABSVALUE 0x04
116#define NOISE_FLAG_POINTBUFFER 0x08
117#define NOISE_FLAG_SIMPLEX 0x10
132 u16 octaves_,
float persist_,
float lacunarity_,
167 float step_x,
float step_y,
170 float x,
float y,
float z,
171 float step_x,
float step_y,
float step_z,
174 float *
perlinMap2D(
float x,
float y,
float *persistence_map=NULL);
175 float *
perlinMap3D(
float x,
float y,
float z,
float *persistence_map=NULL);
178 float *persistence_map=NULL)
187 float z,
float zoff,
float *persistence_map=NULL)
199 void updateResults(
float g,
float *gmap,
const float *persistence_map,
208 float y,
float yoff, s32 seed)
217 float y,
float yoff,
float z,
float zoff, s32 seed)
227float noise2d(
int x,
int y, s32 seed);
228float noise3d(
int x,
int y,
int z, s32 seed);
231float noise3d_gradient(
float x,
float y,
float z, s32 seed,
bool eased=
false);
234 int octaves,
float persistence,
bool eased=
true);
238 return t * t * t * (t * (6.f * t - 15.f) + 10.f);
u32 sz
Definition noise.h:152
Noise(const NoiseParams *np, s32 seed, u32 sx, u32 sy, u32 sz=1)
Definition noise.cpp:362
float * perlinMap3D(float x, float y, float z, float *persistence_map=NULL)
Definition noise.cpp:681
void setSize(u32 sx, u32 sy, u32 sz=1)
Definition noise.cpp:410
s32 seed
Definition noise.h:149
float * perlinMap2D(float x, float y, float *persistence_map=NULL)
Definition noise.cpp:644
float * perlinMap2D_PO(float x, float xoff, float y, float yoff, float *persistence_map=NULL)
Definition noise.h:177
float * perlinMap3D_PO(float x, float xoff, float y, float yoff, float z, float zoff, float *persistence_map=NULL)
Definition noise.h:186
float * result
Definition noise.h:156
float * persist_buf
Definition noise.h:155
void gradientMap3D(float x, float y, float z, float step_x, float step_y, float step_z, s32 seed)
Definition noise.cpp:553
float * gradient_buf
Definition noise.h:154
void setSpreadFactor(v3f spread)
Definition noise.cpp:420
u32 sx
Definition noise.h:150
~Noise()
Definition noise.cpp:374
void setOctaves(int octaves)
Definition noise.cpp:428
NoiseParams np
Definition noise.h:148
void gradientMap2D(float x, float y, float step_x, float step_y, s32 seed)
Definition noise.cpp:491
float * noise_buf
Definition noise.h:153
u32 sy
Definition noise.h:151
void allocBuffers()
Definition noise.cpp:383
void updateResults(float g, float *gmap, const float *persistence_map, size_t bufsize)
Definition noise.cpp:719
void resizeNoiseBuf(bool is3d)
Definition noise.cpp:436
u64 m_state
Definition noise.h:107
s32 randNormalDist(s32 min, s32 max, int num_trials=6)
Definition noise.cpp:147
void seed(u64 state, u64 seq=0xda3e39cb94b95bdbULL)
Definition noise.cpp:57
static const u32 RANDOM_RANGE
Definition noise.h:93
u32 range(u32 bound)
Definition noise.cpp:78
static const s32 RANDOM_MIN
Definition noise.h:91
u32 next()
Definition noise.cpp:67
PcgRandom(u64 state=0x853c49e6748fea9bULL, u64 seq=0xda3e39cb94b95bdbULL)
Definition noise.cpp:52
void bytes(void *out, size_t len)
Definition noise.cpp:127
u64 m_inc
Definition noise.h:108
void getState(u64 state[2]) const
Definition noise.cpp:155
void setState(const u64 state[2])
Definition noise.cpp:161
static const s32 RANDOM_MAX
Definition noise.h:92
Definition exceptions.h:75
s32 getState() const
Definition noise.h:81
PseudoRandom(s32 seed_=0)
Definition noise.h:47
u32 next()
Definition noise.h:57
s32 range(s32 min, s32 max)
Definition noise.h:64
void seed(s32 seed)
Definition noise.h:52
static const u32 RANDOM_RANGE
Definition noise.h:45
s32 m_next
Definition noise.h:86
core::vector3df v3f
Definition irr_v3d.h:11
float NoisePerlin2D_PO(NoiseParams *np, float x, float xoff, float y, float yoff, s32 seed)
Definition noise.h:207
float contour(float v)
Definition noise.cpp:297
FlagDesc flagdesc_noiseparams[]
Definition noise.cpp:41
float noise2d(int x, int y, s32 seed)
Definition noise.cpp:169
float noise3d(int x, int y, int z, s32 seed)
Definition noise.cpp:179
float NoisePerlin3D_PO(NoiseParams *np, float x, float xoff, float y, float yoff, float z, float zoff, s32 seed)
Definition noise.h:216
#define NOISE_FLAG_DEFAULTS
Definition noise.h:111
float noise3d_gradient(float x, float y, float z, s32 seed, bool eased=false)
Definition noise.cpp:253
float NoisePerlin2D(const NoiseParams *np, float x, float y, s32 seed)
Definition noise.cpp:309
float noise2d_gradient(float x, float y, s32 seed, bool eased=true)
Definition noise.cpp:235
float noise2d_perlin(float x, float y, s32 seed, int octaves, float persistence, bool eased=true)
Definition noise.cpp:281
float easeCurve(float t)
Definition noise.h:236
float NoisePerlin3D(const NoiseParams *np, float x, float y, float z, s32 seed)
Definition noise.cpp:335
v3f spread
Definition noise.h:122
float persist
Definition noise.h:125
float offset
Definition noise.h:120
u16 octaves
Definition noise.h:124
u32 flags
Definition noise.h:127
float scale
Definition noise.h:121
NoiseParams(float offset_, float scale_, const v3f &spread_, s32 seed_, u16 octaves_, float persist_, float lacunarity_, u32 flags_=NOISE_FLAG_DEFAULTS)
Definition noise.h:131
float lacunarity
Definition noise.h:126
s32 seed
Definition noise.h:123