Initial commit
This commit is contained in:
38
ZUtil/ZSimplexNoise.cpp
Normal file
38
ZUtil/ZSimplexNoise.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#include <ZUtil/ZUtil.hpp>
|
||||
#include <ZUtil/ZSimplexNoise.hpp>
|
||||
#include <SST/SST_SimplexNoise.h>
|
||||
|
||||
ZSimplexNoise::ZSimplexNoise()
|
||||
{
|
||||
this->simplexGenerator = SST_Random_CreateSimplexNoise();
|
||||
}
|
||||
|
||||
void ZSimplexNoise::reseed(const int _seed)
|
||||
{
|
||||
SST_Random_ReseedSimplexNoise(this->simplexGenerator, _seed);
|
||||
}
|
||||
|
||||
float ZSimplexNoise::noise1(const float _x)
|
||||
{
|
||||
return SST_Random_MapSimplexNoise1D(this->simplexGenerator, _x);
|
||||
}
|
||||
|
||||
// 2D simplex noise
|
||||
float ZSimplexNoise::noise2(const float _x, const float _y)
|
||||
{
|
||||
return SST_Random_MapSimplexNoise2D(this->simplexGenerator, _x, _y);
|
||||
}
|
||||
|
||||
// 3D simplex noise
|
||||
float ZSimplexNoise::noise3(const float _x, const float _y, const float _z)
|
||||
{
|
||||
return SST_Random_MapSimplexNoise3D(this->simplexGenerator, _x, _y, _z);
|
||||
}
|
||||
|
||||
// 4D simplex noise
|
||||
float ZSimplexNoise::noise4(const float _x, const float _y, const float _z, const float _w)
|
||||
{
|
||||
return SST_Random_MapSimplexNoise4D(this->simplexGenerator, _x, _y, _z, _w);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user