Panda3D

Loading...
Searching...
No Matches
Public Member Functions | List of all members
PerlinNoise3 Class Reference

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

`#include "perlinNoise3.h"`

Inheritance diagram for PerlinNoise3:

## Public Member Functions
| PerlinNoise3 ()
| 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.
| PerlinNoise3 (double sx, double sy, double sz, int table_size=256, unsigned long seed=0)
| Randomizes the tables to make a unique noise function.
double | noise (const LVecBase3d &value) 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 (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.
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.
void | operator= (const PerlinNoise3 &copy)
| Makes an exact copy of the existing PerlinNoise object, including its random seed.
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.
void | set_scale (double scale)
| Changes the scale (frequency) of the noise.
void | set_scale (double sx, double sy, double sz)
| Changes the scale (frequency) of the noise.
Public Member Functions inherited from PerlinNoise
unsigned long | get_seed ()
| Returns a unique seed value based on the seed value passed to this PerlinNoise object (and on its current state).

## 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 25 of file perlinNoise3.h.

## Constructor & Destructor Documentation

## ◆ PerlinNoise3() [1/3]

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 18 of file perlinNoise3.I.

Referenced by PerlinNoise3(), and operator=().

## ◆ PerlinNoise3() [2/3]

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

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 32 of file perlinNoise3.I.

References set_scale().

## ◆ PerlinNoise3() [3/3]

PerlinNoise3::PerlinNoise3 | ( | const PerlinNoise3 & | copy | ) |
| inline

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

Definition at line 45 of file perlinNoise3.I.

References PerlinNoise3().

## Member Function Documentation

## ◆ noise() [1/3]

double PerlinNoise3::noise | ( | const LVecBase3d & | value | ) | const

Returns the noise function of the three inputs.

Definition at line 20 of file perlinNoise3.cxx.

## ◆ noise() [2/3]

float PerlinNoise3::noise | ( | const LVecBase3f & | value | ) | const
| inline

Returns the noise function of the three inputs.

Definition at line 107 of file perlinNoise3.I.

References noise().

## ◆ noise() [3/3]

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

Returns the noise function of the three inputs.

Definition at line 99 of file perlinNoise3.I.

References noise().

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

## ◆ operator()() [1/3]

double PerlinNoise3::operator() | ( | const LVecBase3d & | value | ) | const
| inline

Returns the noise function of the three inputs.

Definition at line 131 of file perlinNoise3.I.

References noise().

## ◆ operator()() [2/3]

float PerlinNoise3::operator() | ( | const LVecBase3f & | value | ) | const
| inline

Returns the noise function of the three inputs.

Definition at line 123 of file perlinNoise3.I.

References noise().

## ◆ operator()() [3/3]

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

Returns the noise function of the three inputs.

Definition at line 115 of file perlinNoise3.I.

References noise().

## ◆ operator=()

void PerlinNoise3::operator= | ( | const PerlinNoise3 & | copy | ) |
| inline

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

Definition at line 57 of file perlinNoise3.I.

References PerlinNoise3().

## ◆ set_scale() [1/4]

void PerlinNoise3::set_scale | ( | const LVecBase3d & | scale | ) |
| inline

Changes the scale (frequency) of the noise.

Definition at line 91 of file perlinNoise3.I.

## ◆ set_scale() [2/4]

void PerlinNoise3::set_scale | ( | const LVecBase3f & | scale | ) |
| inline

Changes the scale (frequency) of the noise.

Definition at line 83 of file perlinNoise3.I.

References set_scale().

## ◆ set_scale() [3/4]

void PerlinNoise3::set_scale | ( | double | scale | ) |
| inline

Changes the scale (frequency) of the noise.

Definition at line 67 of file perlinNoise3.I.

References set_scale().

Referenced by PerlinNoise3(), set_scale(), set_scale(), and set_scale().

## ◆ set_scale() [4/4]

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

Changes the scale (frequency) of the noise.

Definition at line 75 of file perlinNoise3.I.

References set_scale().

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

- panda/src/mathutil/perlinNoise3.h
- panda/src/mathutil/perlinNoise3.cxx
- panda/src/mathutil/perlinNoise3.I