Heightfield 1.0
AnalyticMusgrave Class Reference

Musgrave's original ridged multifractal terrain model. More...

#include <analyticfield.h>

Inheritance diagram for AnalyticMusgrave:
AnalyticHeightField AnalyticScalarField2

Public Member Functions

 AnalyticMusgrave (const double &, const double &, const double &, const double &, int, const double &, const double &, const Vector2 &=Vector2::Null)
 Constructor.
 
double Value (const Vector2 &) const
 Compute the field function.
 
- Public Member Functions inherited from AnalyticHeightField
 AnalyticHeightField ()
 Empty.
 
virtual double Height (const Vector2 &) const
 Compute elevation at a given point.
 
virtual Vector Normal (const Vector2 &) const
 Compute the normal to the field.
 
HeightField CreateHeightField (const Box2 &, int, int) const
 Create a HeightField given an input domain.
 
double Slope (const Vector2 &) const
 Compute the slope at a given point.
 
double AverageSlope (const Vector2 &, int=8) const
 Compute the average slope at a given point.
 
double Slope (const Vector2 &, const Vector2 &) const
 Compute the slope in a given direction and at a given point.
 
QVector< double > Cross (const Vector2 &, const Vector2 &, int) const
 Compute the elevation along a segment.
 

Static Public Member Functions

static double Ridge (double)
 Musgrave ridge function.
 
- Static Public Member Functions inherited from AnalyticHeightField
static double Ridge (const double &, const double &=0.0)
 Ridge function.
 

Protected Attributes

double z0
 Base noise function, the same for all Musgrave fractal terrains.
 
double amp
 Amplitude.
 
double wave
 Wavelength.
 
double lacunarity
 Hurst exponent.
 
int octaves
 Number of octaves.
 

Additional Inherited Members

- Static Protected Attributes inherited from AnalyticHeightField
static double Epsilon = 1e-6
 Epsilon value used for gradient computation.
 

Detailed Description

Musgrave's original ridged multifractal terrain model.

Constructor & Destructor Documentation

◆ AnalyticMusgrave()

AnalyticMusgrave::AnalyticMusgrave ( const double & z,
const double & a,
const double & wave,
const double & lacunarity,
int o,
const double & gain,
const double & H,
const Vector2 & tt = Vector2::Null )
explicit

Constructor.

Parameters
zConstant (base) elevation.
aVertical scaling factor.
waveStarting wavelength.
lacunarityLacunarity.
oNumber of signals.
gainGain.
HHurst exponent.
ttOffset vector.

Member Function Documentation

◆ Ridge()

double AnalyticMusgrave::Ridge ( double y)
inlinestatic

Musgrave ridge function.

Should be applied to a noise function value. Ridges are created by taking the absolute value of the input signal, and squaring the result to amplify the ridged effect.

Parameters
ySignal, should be a noise value in [-1,1].

◆ Value()

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

Compute the field function.

Parameters
pPoint.

Reimplemented from AnalyticScalarField2.

Member Data Documentation

◆ z0

double AnalyticMusgrave::z0
protected

Base noise function, the same for all Musgrave fractal terrains.

Base elevation.