#include <PerlinNoise.h>
Public Member Functions | |
PerlinNoise (const float persistence, const float frequency, const int octaves) | |
FIXME comments what persistence,frequency,octabes mean. | |
~PerlinNoise () | |
const float | perlinNoise (float x, float y) const |
const float | perlinNoise3D (float x, float y, float z) const |
Private Member Functions | |
const float | noise (const int x, const int y) const |
const float | cosInterpolate (const float a, const float b, const float x) const |
const float | weightedNoise (const int x, const int y) const |
const float | interpolatedNoise (const float x, const float y) const |
const float | noise3D (const int x, const int y, const int z) const |
const float | interpolatedNoise3D (const float x, const float y, const float z) const |
Private Attributes | |
const float | mPersistence |
the persistence value | |
const float | mFrequency |
the frequency value | |
const int | mOctaves |
the octaves |
Definition at line 12 of file PerlinNoise.h.
PerlinNoise::PerlinNoise | ( | const float | persistence, | |
const float | frequency, | |||
const int | octaves | |||
) | [inline] |
FIXME comments what persistence,frequency,octabes mean.
Constructor for the Perlin Noise function. Here you have to set the apropiate values
Definition at line 22 of file PerlinNoise.h.
PerlinNoise::~PerlinNoise | ( | ) | [inline] |
Destructor
Definition at line 30 of file PerlinNoise.h.
const float PerlinNoise::perlinNoise | ( | float | x, | |
float | y | |||
) | const [inline] |
generates perlin Noise the default values are good for clouds
x | The x point for which we generate noise | |
y | the y point for which we generate noise |
Definition at line 39 of file PerlinNoise.h.
References interpolatedNoise(), mFrequency, mOctaves, and mPersistence.
Referenced by CloudShader::shade().
const float PerlinNoise::perlinNoise3D | ( | float | x, | |
float | y, | |||
float | z | |||
) | const [inline] |
A perlin noise 3d function
x | The x point for which we generate noise | |
y | the y point for which we generate noise | |
z | the z point for which we generate noise |
Definition at line 59 of file PerlinNoise.h.
References interpolatedNoise3D(), mFrequency, mOctaves, and mPersistence.
Referenced by WoodShader::shade().
const float PerlinNoise::noise | ( | const int | x, | |
const int | y | |||
) | const [inline, private] |
a pseudo random noise function
Definition at line 83 of file PerlinNoise.h.
Referenced by weightedNoise().
const float PerlinNoise::cosInterpolate | ( | const float | a, | |
const float | b, | |||
const float | x | |||
) | const [inline, private] |
Cosine interpolation
Definition at line 93 of file PerlinNoise.h.
Referenced by interpolatedNoise().
const float PerlinNoise::weightedNoise | ( | const int | x, | |
const int | y | |||
) | const [inline, private] |
Weighted noise (on a square)
Definition at line 102 of file PerlinNoise.h.
References noise().
Referenced by interpolatedNoise().
const float PerlinNoise::interpolatedNoise | ( | const float | x, | |
const float | y | |||
) | const [inline, private] |
Interpolated noise on a arbitrary point
Definition at line 113 of file PerlinNoise.h.
References cosInterpolate(), and weightedNoise().
Referenced by perlinNoise().
const float PerlinNoise::noise3D | ( | const int | x, | |
const int | y, | |||
const int | z | |||
) | const [inline, private] |
a 3d random function
Definition at line 138 of file PerlinNoise.h.
Referenced by interpolatedNoise3D().
const float PerlinNoise::interpolatedNoise3D | ( | const float | x, | |
const float | y, | |||
const float | z | |||
) | const [inline, private] |
interpolating 3d noise
Definition at line 149 of file PerlinNoise.h.
References lerp(), and noise3D().
Referenced by perlinNoise3D().
const float PerlinNoise::mPersistence [private] |
the persistence value
Definition at line 76 of file PerlinNoise.h.
Referenced by perlinNoise(), and perlinNoise3D().
const float PerlinNoise::mFrequency [private] |
the frequency value
Definition at line 77 of file PerlinNoise.h.
Referenced by perlinNoise(), and perlinNoise3D().
const int PerlinNoise::mOctaves [private] |
the octaves
Definition at line 78 of file PerlinNoise.h.
Referenced by perlinNoise(), and perlinNoise3D().