geomc 1.0
A c++ linear algebra template library
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
PerlinNoise< T, N > Class Template Reference

Real-valued smooth noise over N dimensions. More...

#include <geomc/function/PerlinNoise.h>

Public Types

typedef PointType< index_t, N > gridtype
 
typedef PointType< T, N > pointtype
 
typedef gridtype::point_t grid_t
 
typedef pointtype::point_t point_t
 Coordinate type: Vec<T,N> if N > 0; T if N == 1.
 

Public Member Functions

 PerlinNoise ()
 
 PerlinNoise (Random *rng)
 
eval (point_t pt) const
 
std::pair< T, point_tgradient (point_t pt) const
 

Public Attributes

boost::shared_array< point_tgradients
 
boost::shared_array< index_t > p
 

Protected Member Functions

const point_tget_grid_gradient (const grid_t &pt) const
 

Static Protected Member Functions

static grid_t corner (index_t i)
 
static T fade (T t)
 
static T dfade_dt (T t)
 

Friends

class detail::_ImplPerlinInit< T, N >
 

Detailed Description

template<typename T, index_t N>
class geom::PerlinNoise< T, N >

Real-valued smooth noise over N dimensions.

Perlin noise has _O(2N)_ time cost.

Constructor & Destructor Documentation

◆ PerlinNoise() [1/2]

PerlinNoise ( )
inline

Construct a new perlin noise object with the default (non-reentrant) random number generator.

◆ PerlinNoise() [2/2]

PerlinNoise ( Random rng)
inline

Construct a new perlin noise object with the supplied random number generator.

Parameters
rngA source of random bits.

Member Function Documentation

◆ eval()

T eval ( point_t  pt) const
inline

Evaluate the noise at pt.

◆ gradient()

std::pair< T, point_t > gradient ( point_t  pt) const
inline

Evaluate the gradient of the noise function at pt.

Parameters
ptLocation at which to sample the noise function.
Returns
A pair of (noise(x), gradient(noise(x))).

The documentation for this class was generated from the following files: