Core 1.0
|
Turbulence computed from a modified noise function. More...
#include <turbulence.h>
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... | |
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.
|
explicit |
Creates a turbulence field.
v0,a0,l0 | Base value, amplitude and wavelength. |
alpha,lambda | Amplitude and wavelength attenuation (should be less than 1.0 in general). |
octaves | Number of octaves. |
t | Offset vector. |
double NoiseTurbulence2::K | ( | ) | const |
Return the global Lipschitz constant.
double NoiseTurbulence2::Maximum | ( | ) | const |
Computes the maximum of the turbulence.
Sums the maximum of the terms of the series of scaled noise.
|
virtual |
Create a discrete scalar field by sampling a given domain.
a | Domain. |
Reimplemented from AnalyticScalarField2.