Panda3D
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
PerlinNoise Class Reference

This is the base class for PerlinNoise2 and PerlinNoise3, different dimensions of Perlin noise implementation. More...

#include "perlinNoise.h"

Inheritance diagram for PerlinNoise:
PerlinNoise2 PerlinNoise3

List of all members.

Public Member Functions

unsigned long get_seed ()
 Returns a unique seed value based on the seed value passed to this PerlinNoise object (and on its current state).

Protected Types

typedef vector_int Index

Protected Member Functions

 PerlinNoise (int table_size, unsigned long seed)
 Randomizes the tables to make a unique noise function.
 PerlinNoise (const PerlinNoise &copy)
 Makes an exact copy of the existing PerlinNoise object, including its random seed.
void operator= (const PerlinNoise &copy)
 Makes an exact copy of the existing PerlinNoise object, including its random seed.

Static Protected Member Functions

static double fade (double t)
 Returns a smooth interpolation spline from 0 .
static double lerp (double t, double a, double b)
 Returns the smoothly lerped value from a to b.

Protected Attributes

Index _index
Randomizer _randomizer
int _table_size
int _table_size_mask

Detailed Description

This is the base class for PerlinNoise2 and PerlinNoise3, different dimensions of Perlin noise implementation.

The base class just collects the common functionality.

Definition at line 31 of file perlinNoise.h.


Constructor & Destructor Documentation

PerlinNoise::PerlinNoise ( int  table_size,
unsigned long  seed 
) [protected]

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 27 of file perlinNoise.cxx.

References Randomizer::random_int().

PerlinNoise::PerlinNoise ( const PerlinNoise copy) [protected]

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

Definition at line 72 of file perlinNoise.cxx.


Member Function Documentation

double PerlinNoise::fade ( double  t) [inline, static, protected]

Returns a smooth interpolation spline from 0 .

. 1 for t.

Definition at line 23 of file perlinNoise.I.

Referenced by PerlinNoise3::noise(), and PerlinNoise2::noise().

unsigned long PerlinNoise::get_seed ( ) [inline]

Returns a unique seed value based on the seed value passed to this PerlinNoise object (and on its current state).

Definition at line 46 of file perlinNoise.I.

References Randomizer::get_seed().

Referenced by StackedPerlinNoise2::StackedPerlinNoise2(), and StackedPerlinNoise3::StackedPerlinNoise3().

double PerlinNoise::lerp ( double  t,
double  a,
double  b 
) [inline, static, protected]

Returns the smoothly lerped value from a to b.

Definition at line 34 of file perlinNoise.I.

Referenced by PerlinNoise3::noise(), and PerlinNoise2::noise().

void PerlinNoise::operator= ( const PerlinNoise copy) [protected]

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

Definition at line 87 of file perlinNoise.cxx.


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