Gamedev Framework (gf)  0.1.0
A C++11 framework for 2D games
Public Member Functions | List of all members
gf::FractalNoise Class Reference

Fractal noise. More...

#include <gf/Noise.h>

Public Member Functions

 FractalNoise (std::function< double(double, double)> noise, double scale, std::size_t octaves=8, double lacunarity=2.0, double persistence=0.5, double dimension=1.0)
 Constructor. More...
double operator() (double x, double y) const
 Take a noise value. More...

Detailed Description

Fractal noise.

Fractal noise is based of fractional Brownian motion (fBm). It consists in adding several octaves of a basic noise at different amplitudes.

Constructor & Destructor Documentation

gf::FractalNoise::FractalNoise ( std::function< double(double, double)>  noise,
double  scale,
std::size_t  octaves = 8,
double  lacunarity = 2.0,
double  persistence = 0.5,
double  dimension = 1.0 


noiseThe basic noise function
scaleThe scale factor
octavesThe number of octaves
lacunarityThe factor applied to frequency
persistenceThe factor applied to amplitude
dimensionThe contrast between the layers

Member Function Documentation

double gf::FractalNoise::operator() ( double  x,
double  y 
) const

Take a noise value.

xThe x coordinate of the noise value
yThe y coordinate of the noise value
The noise value