Panda3D
Public Member Functions

PerlinNoise3 Class Reference

This class provides an implementation of Perlin noise for 3 variables. More...

#include "perlinNoise3.h"

Inheritance diagram for PerlinNoise3:
PerlinNoise

List of all members.

Public Member Functions

 PerlinNoise3 ()
 Randomizes the tables to make a unique noise function.
 PerlinNoise3 (double sx, double sy, double sz, int table_size=256, unsigned long seed=0)
 Randomizes the tables to make a unique noise function.
 PerlinNoise3 (const PerlinNoise3 &copy)
 Makes an exact copy of the existing PerlinNoise object, including its random seed.
double noise (double x, double y, double z) const
 Returns the noise function of the three inputs.
float noise (const LVecBase3f &value) const
 Returns the noise function of the three inputs.
double noise (const LVecBase3d &value) const
 Returns the noise function of the three inputs.
float operator() (const LVecBase3f &value) const
 Returns the noise function of the three inputs.
double operator() (double x, double y, double z) const
 Returns the noise function of the three inputs.
double operator() (const LVecBase3d &value) const
 Returns the noise function of the three inputs.
void operator= (const PerlinNoise3 &copy)
 Makes an exact copy of the existing PerlinNoise object, including its random seed.
void set_scale (double sx, double sy, double sz)
 Changes the scale (frequency) of the noise.
void set_scale (double scale)
 Changes the scale (frequency) of the noise.
void set_scale (const LVecBase3d &scale)
 Changes the scale (frequency) of the noise.
void set_scale (const LVecBase3f &scale)
 Changes the scale (frequency) of the noise.

Detailed Description

This class provides an implementation of Perlin noise for 3 variables.

This code is loosely based on the reference implementation at http://mrl.nyu.edu/~perlin/noise/ .

Definition at line 28 of file perlinNoise3.h.


Constructor & Destructor Documentation

PerlinNoise3::PerlinNoise3 ( ) [inline]

Randomizes the tables to make a unique noise function.

Uses a default scale (noise frequency), table size, and seed.

Definition at line 24 of file perlinNoise3.I.

PerlinNoise3::PerlinNoise3 ( double  sx,
double  sy,
double  sz,
int  table_size = 256,
unsigned long  seed = 0 
) [inline]

Randomizes the tables to make a unique noise function.

If seed is nonzero, it is used to define the tables; if it is zero a random seed is generated.

Definition at line 41 of file perlinNoise3.I.

References set_scale().

PerlinNoise3::PerlinNoise3 ( const PerlinNoise3 copy) [inline]

Makes an exact copy of the existing PerlinNoise object, including its random seed.

Definition at line 56 of file perlinNoise3.I.


Member Function Documentation

double PerlinNoise3::noise ( double  x,
double  y,
double  z 
) const [inline]

Returns the noise function of the three inputs.

Definition at line 122 of file perlinNoise3.I.

Referenced by noise(), and operator()().

double PerlinNoise3::noise ( const LVecBase3d value) const

Returns the noise function of the three inputs.

Definition at line 24 of file perlinNoise3.cxx.

References PerlinNoise::fade(), PerlinNoise::lerp(), and LMatrix4d::xform_point().

float PerlinNoise3::noise ( const LVecBase3f value) const [inline]

Returns the noise function of the three inputs.

Definition at line 132 of file perlinNoise3.I.

References noise().

double PerlinNoise3::operator() ( const LVecBase3d value) const [inline]

Returns the noise function of the three inputs.

Definition at line 162 of file perlinNoise3.I.

References noise().

double PerlinNoise3::operator() ( double  x,
double  y,
double  z 
) const [inline]

Returns the noise function of the three inputs.

Definition at line 142 of file perlinNoise3.I.

References noise().

float PerlinNoise3::operator() ( const LVecBase3f value) const [inline]

Returns the noise function of the three inputs.

Definition at line 152 of file perlinNoise3.I.

References noise().

void PerlinNoise3::operator= ( const PerlinNoise3 copy) [inline]

Makes an exact copy of the existing PerlinNoise object, including its random seed.

Definition at line 70 of file perlinNoise3.I.

void PerlinNoise3::set_scale ( const LVecBase3f scale) [inline]

Changes the scale (frequency) of the noise.

Definition at line 102 of file perlinNoise3.I.

References set_scale().

void PerlinNoise3::set_scale ( double  scale) [inline]

Changes the scale (frequency) of the noise.

Definition at line 82 of file perlinNoise3.I.

Referenced by PerlinNoise3(), and set_scale().

void PerlinNoise3::set_scale ( double  sx,
double  sy,
double  sz 
) [inline]

Changes the scale (frequency) of the noise.

Definition at line 92 of file perlinNoise3.I.

References set_scale().

void PerlinNoise3::set_scale ( const LVecBase3d scale) [inline]

Changes the scale (frequency) of the noise.

Definition at line 112 of file perlinNoise3.I.

References LMatrix4d::scale_mat().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations