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

Perlin 2D noise. More...

#include <gf/Noises.h>

Inheritance diagram for gf::PerlinNoise2D:
Inheritance graph
[legend]

Public Member Functions

 PerlinNoise2D (Random &random, double scale, std::size_t octaves=8)
 Constructor. More...
 
virtual double getValue (double x, double y) override
 Take a 2D noise value. More...
 
- Public Member Functions inherited from gf::Noise2D
virtual ~Noise2D ()
 Virtual destructor. More...
 
double operator() (double x, double y)
 Take a 2D noise value. More...
 

Detailed Description

Perlin 2D noise.

Perlin noise is the combination of a fractal noise and a gradient noise.

See also
gf::GradientNoise2D, gf::FractalNoise2D

Constructor & Destructor Documentation

gf::PerlinNoise2D::PerlinNoise2D ( Random random,
double  scale,
std::size_t  octaves = 8 
)

Constructor.

Parameters
randomA random engine
scaleThe scale factor
octavesThe number of octaves

Member Function Documentation

virtual double gf::PerlinNoise2D::getValue ( double  x,
double  y 
)
overridevirtual

Take a 2D noise value.

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

Implements gf::Noise2D.