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

Turbulence computed from a modified noise function. More...

#include <turbulence.h>

Inheritance diagram for NoiseTurbulence2:
Noise2 AnalyticScalarField2

Public Member Functions

 NoiseTurbulence2 (const double &=0.0, const double &=1.0, const double &=1.0, const double &=0.5, const double &=0.5, int=5, const Vector &=Vector::Null)
 Creates a turbulence field. More...
 
 ~NoiseTurbulence2 ()
 Destroys a turbulence instance.
 
double Value (const Vector2 &) const
 Compute the turbulence value at a given point. More...
 
double Omega () const
 Return the amplitude dampening coefficient.
 
double Lambda () const
 Return the wavelength dampening coefficient.
 
int Octaves () const
 Number of octaves.
 
double K () const
 Return the global Lipschitz constant. More...
 
double Maximum () const
 Computes the maximum of the turbulence. More...
 
virtual ScalarField2 Sample (const Array2 &) const
 Create a discrete scalar field by sampling a given domain. More...
 
- Public Member Functions inherited from Noise2
 Noise2 (bool=false)
 Create a noise function. More...
 
 ~Noise2 ()
 Empty.
 
double K () const
 Return the global Lipschitz constant of the noise.
 
- Public Member Functions inherited from AnalyticScalarField2
 AnalyticScalarField2 ()
 Create an analytic scalar field defined over the entire plane.
 
virtual Vector2 Gradient (const Vector2 &) const
 Compute the gradient of the field. More...
 
virtual Matrix2 Hessian (const Vector2 &) const
 Compute the hessian at a given point. More...
 
void Curvature (const Vector2 &, double &, double &) const
 Compute the gaussian and mean curvatures. More...
 
virtual Box2 GetBox () const
 Return the bounding box.
 

Protected Attributes

double v0 = 0.0
 Base value.
 
double a0 = 1.0
 Base amplitude.
 
double l0 = 1.0
 Wavelength.
 
double alpha = 0.5
 Amplitude attenuation coefficient.
 
double lambda = 0.5
 Wavelength amplification coefficient.
 
int octaves = 8
 Number of octaves.
 
Vector t = Vector::Null
 Translation.
 
- Protected Attributes inherited from Noise2
bool quintic
 Flag defining interpolation type: either cubic (false) or quintic (true).
 
- Protected Attributes inherited from AnalyticScalarField2
Box2 box = Box2::Infinity
 Domain, set as infinite for base class.
 

Static Protected Attributes

static const Matrix2 R2 = Matrix2::Rotation(4.0 * Math::Pi / 19.0)
 Random incremental rotation in the plane.
 
- Static Protected Attributes inherited from Noise2
static double rtable [267]
 Random double table.
 
static const short hashTable [4096]
 Hash table.
 
- Static Protected Attributes inherited from AnalyticScalarField2
static const double epsilon = 1e-6
 \epsilon; value for partial derivatives
 

Additional Inherited Members

- Protected Member Functions inherited from AnalyticScalarField2
Matrix Local (const Vector2 &) const
 Compute the local neighborhood in the one-ring aroung a point. More...
 

Detailed Description

Turbulence computed from a modified noise function.

A turbulence field is characterized by the number of octaves, the attenuation of the amplitude of the noise summed at every step, and by the amplification of the wavelength.

Constructor & Destructor Documentation

◆ NoiseTurbulence2()

NoiseTurbulence2::NoiseTurbulence2 ( const double &  v = 0.0,
const double &  a = 1.0,
const double &  l = 1.0,
const double &  alpha = 0.5,
const double &  lambda = 0.5,
int  octaves = 5,
const Vector t = Vector::Null 
)
explicit

Creates a turbulence field.

Parameters
v0,a0,l0Base value, amplitude and wavelength.
alpha,lambdaAmplitude and wavelength attenuation (should be less than 1.0 in general).
octavesNumber of octaves.
tOffset vector.

Member Function Documentation

◆ K()

double NoiseTurbulence2::K ( ) const

Return the global Lipschitz constant.

See also
Noise::K()

◆ Maximum()

double NoiseTurbulence2::Maximum ( ) const

Computes the maximum of the turbulence.

Sums the maximum of the terms of the series of scaled noise.

◆ Sample()

ScalarField2 AnalyticScalarField2::Sample ( const Array2 a) const
virtual

Create a discrete scalar field by sampling a given domain.

Parameters
aDomain.

Reimplemented from AnalyticScalarField2.

◆ Value()

double NoiseTurbulence2::Value ( const Vector2 p) const
virtual

Compute the turbulence value at a given point.

Sums a series of scaled noise functions.

Parameters
pPoint.

Reimplemented from Noise2.