Raytracer
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Raytracer::Utils::Perlin Class Reference

Public Member Functions

 Perlin ()
 Construct a new Perlin object.
 
 ~Perlin ()
 Destroy the Perlin object.
 
double noise (const Utils::Point3 &point) const
 Get the noise value at the given point.
 
double turbulence (const Utils::Point3 &point, int depth=7) const
 Get the turbulence value at the given point.
 

Static Public Member Functions

static int * perlinGeneratePerm ()
 Generate the permutation table.
 
static void permute (int *perm, int n)
 Permute the permutation table.
 
static double perlinInterp (const Utils::Vec3 c[2][2][2], double u, double v, double w)
 Interpolate the noise value.
 

Constructor & Destructor Documentation

◆ Perlin()

Raytracer::Utils::Perlin::Perlin ( )

Construct a new Perlin object.

This function constructs a new Perlin object. The Perlin object is a Perlin noise generator. The Perlin noise is a type of gradient noise.

Returns
A new Perlin object.

◆ ~Perlin()

Raytracer::Utils::Perlin::~Perlin ( )

Destroy the Perlin object.

This function destroys the Perlin object.

Member Function Documentation

◆ noise()

double Raytracer::Utils::Perlin::noise ( const Utils::Point3 & point) const

Get the noise value at the given point.

This function returns the noise value at the given point.

Parameters
pointThe point.
Returns
The noise value.

◆ perlinGeneratePerm()

int * Raytracer::Utils::Perlin::perlinGeneratePerm ( )
static

Generate the permutation table.

This function generates the permutation table.

Returns
The permutation table.

◆ perlinInterp()

double Raytracer::Utils::Perlin::perlinInterp ( const Utils::Vec3 c[2][2][2],
double u,
double v,
double w )
static

Interpolate the noise value.

This function interpolates the noise value.

Parameters
cThe noise value.
uThe U coordinate.
vThe V coordinate.
wThe W coordinate.
Returns
The interpolated noise value.

◆ permute()

void Raytracer::Utils::Perlin::permute ( int * perm,
int n )
static

Permute the permutation table.

This function permutes the permutation table.

Parameters
permThe permutation table.
nThe size of the permutation table.

◆ turbulence()

double Raytracer::Utils::Perlin::turbulence ( const Utils::Point3 & point,
int depth = 7 ) const

Get the turbulence value at the given point.

This function returns the turbulence value at the given point.

Parameters
pointThe point.
depthThe depth.
Returns
The turbulence value.

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