Core 1.0
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Noise Class Reference

Perlin noise. More...

#include <noise.h>

Inheritance diagram for Noise:
NoiseTurbulence

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.
 

Detailed Description

Perlin noise.

This class is used as a core class to create various types of fractal noise, such as sums of scaled noises.

See also
SimplexNoise

Constructor & Destructor Documentation

◆ Noise()

Noise::Noise ( bool  quintic = false)

Create a noise function.

Parameters
quinticFlag defining whether quintic interpolation will be used, noise uses cubic interpolation if set to false.

Member Function Documentation

◆ At()

double Noise::At ( const Vector p) const

Compute noise at a given point.

Parameters
pPoint.

◆ AtGradient()

double Noise::AtGradient ( const Vector p,
Vector n 
) const

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.

Parameters
pPoint.
nReturned gradient.
Returns
The noise value.

◆ AtVector()

Vector Noise::AtVector ( const Vector p) const

Vector version of Perlin-style noise function.

Parameters
pPoint

◆ Gradient()

Vector Noise::Gradient ( const Vector p) const

Compute noise at a given point in the plane.

Parameters
pPoint.

Compute the gradient of the noise function at a given point.

Parameters
pPoint.