Core 1.0
|
Perlin noise. More...
#include <noise.h>
Public Member Functions | |
Noise (bool=false) | |
Create a noise function. More... | |
~Noise () | |
Empty. | |
double | At (const Vector &) const |
Compute noise at a given point. More... | |
Vector | Gradient (const Vector &) const |
Compute noise at a given point in the plane. More... | |
double | AtGradient (const Vector &, Vector &) const |
Compute the gradient of the noise function at a given point. More... | |
double | K () const |
Return the global Lipschitz constant of the noise. | |
Vector | AtVector (const Vector &) const |
Vector version of Perlin-style noise function. More... | |
Protected Attributes | |
bool | quintic |
Flag defining interpolation type: either cubic (false) or quintic (true). | |
Static Protected Attributes | |
static double | rtable [267] |
Random double table. | |
static const short | hashTable [4096] |
Hash table. | |
Perlin noise.
This class is used as a core class to create various types of fractal noise, such as sums of scaled noises.
Noise::Noise | ( | bool | quintic = false | ) |
Create a noise function.
quintic | Flag defining whether quintic interpolation will be used, noise uses cubic interpolation if set to false. |
double Noise::At | ( | const Vector & | p | ) | const |
Compute noise at a given point.
p | Point. |
Compute the gradient of the noise function at a given point.
Note that it is much faster to call this function rather than calling Noise::Gradient() and NoiseAt() consecutively.
p | Point. |
n | Returned gradient. |
Vector version of Perlin-style noise function.
p | Point |