Core 1.0
CellularNoise Class Reference

Three-dimensional procedural noise using Voronoi decomposition of space. More...

#include <voronoise.h>

Inheritance diagram for CellularNoise:
InfiniteArray

Public Member Functions

 CellularNoise ()
 Create a cellular noise.
double Value (const Vector &) const
 Compute the noise at a given point.

Additional Inherited Members

Protected Member Functions inherited from InfiniteArray
 InfiniteArray ()
 Constructor.
void Square (const Vector2 &, int &, int &) const
 Compute the cubic cell coordinates.
void Square (const Vector2 &, int &, int &, double &, double &) const
 Compute the local coordinates inside a cubic cell.
void Square (const Vector &, int &, int &, int &) const
 Compute the cubic cell coordinates.
void Square (const Vector &, int &, int &, int &, double &, double &, double &) const
 Compute the local coordinates inside a cubic cell.
Vector2 CellVertex (int, int) const
 Compute a random point in a cell.
Vector CellVertex (int, int, int) const
 Compute a random point in a cell.
Protected Attributes inherited from InfiniteArray
unsigned int o = 0
 Random offset.
Static Protected Attributes inherited from InfiniteArray
static Xoshiro256 random
 Fast random number generator.

Detailed Description

Three-dimensional procedural noise using Voronoi decomposition of space.

The noise is a function of the distance to the nearest seed, one random seed being placed in every cell of the grid.

Member Function Documentation

◆ Value()

double CellularNoise::Value ( const Vector & p) const

Compute the noise at a given point.

The value is the distance to the nearest seed, mapped linearly onto [-1,1]. The seed of the cell containing p is at most sqrt(3) away, so the value is always in [-1,1]: -1 is reached on a seed, and 1 only in the limit where the seeds of all neighbouring cells sit at the opposite corners of their cells, which has a vanishing probability. In practice values stay below about 0.42.

Parameters
pPoint.