Core 1.0
CellularTurbulence2 Class Reference

Fractal Brownian motion from a cellular noise function. More...

#include <turbulence.h>

Public Member Functions

 CellularTurbulence2 (const double &, const double &, const double &, const double &=0.5, const double &=0.5, int=8, const Vector2 &=Vector2::Null)
 Create a scaled turbulence.
 
 CellularTurbulence2 ()
 Unit turbulence.
 
 ~CellularTurbulence2 ()
 Empty.
 
virtual double Value (const Vector2 &) const
 Compute the value of the field.
 

Protected Member Functions

double UnitAt (const Vector2 &) const
 Compute the turbulence value at a given point.
 

Protected Attributes

double alpha = 0.5
 Amplitude attenuation coefficient.
 
double lambda = 0.5
 Wavelength amplification coefficient.
 
int octaves = 4
 Number of octaves.
 
Vector2 t = Vector2::Null
 Translation.
 
double v0 = 0.0
 Base value.
 
double a0 = 1.0
 Base amplitude.
 
double l0 = 1.0
 Wavelength.
 

Static Protected Attributes

static const Matrix2 R2 = Matrix2::Rotation(4.0 * Math::Pi / 19.0)
 Random incremental rotation in the plane.
 

Detailed Description

Fractal Brownian motion from a cellular noise function.

Constructor & Destructor Documentation

◆ CellularTurbulence2()

CellularTurbulence2::CellularTurbulence2 ( const double & v,
const double & a,
const double & l,
const double & alpha = 0.5,
const double & lambda = 0.5,
int octaves = 8,
const Vector2 & t = Vector2::Null )
explicit

Create a scaled turbulence.

Parameters
v,a,lBase value, amplitude and wavelength.
alphaAmplitude attenuation factor (~0.5, should be less than 1.0).
lambdaWavelength attenuation factor (~0.5, should be less than 1.0).
octavesNumber of octaves.
tTranslation offset.

Member Function Documentation

◆ UnitAt()

double CellularTurbulence2::UnitAt ( const Vector2 & p) const
protected

Compute the turbulence value at a given point.

Sums a series of scaled noise functions.

Parameters
pPoint.

◆ Value()

double CellularTurbulence2::Value ( const Vector2 & p) const
virtual

Compute the value of the field.

Parameters
pPoint.

Reimplemented from AnalyticScalarField2.