Panda3D
panda
src
mathutil
stackedPerlinNoise2.h
Go to the documentation of this file.
1
/**
2
* PANDA 3D SOFTWARE
3
* Copyright (c) Carnegie Mellon University. All rights reserved.
4
*
5
* All use of this software is subject to the terms of the revised BSD
6
* license. You should have received a copy of this license along
7
* with this source code in a file named "LICENSE."
8
*
9
* @file stackedPerlinNoise2.h
10
* @author drose
11
* @date 2005-10-05
12
*/
13
14
#ifndef STACKEDPERLINNOISE2_H
15
#define STACKEDPERLINNOISE2_H
16
17
#include "
pandabase.h
"
18
#include "
perlinNoise2.h
"
19
#include "
pvector.h
"
20
21
/**
22
* Implements a multi-layer PerlinNoise, with one or more high-frequency noise
23
* functions added to a lower-frequency base noise function.
24
*/
25
class
EXPCL_PANDA_MATHUTIL
StackedPerlinNoise2
{
26
PUBLISHED:
27
INLINE
StackedPerlinNoise2
();
28
explicit
StackedPerlinNoise2
(
double
sx,
double
sy,
int
num_levels = 2,
29
double
scale_factor = 4.0f,
double
amp_scale = 0.5f,
30
int
table_size = 256,
unsigned
long
seed = 0);
31
StackedPerlinNoise2
(
const
StackedPerlinNoise2
©);
32
void
operator = (
const
StackedPerlinNoise2
©);
33
34
void
add_level(
const
PerlinNoise2
&level,
double
amp = 1.0);
35
void
clear();
36
37
INLINE
double
noise(
double
x,
double
y);
38
INLINE
float
noise(
const
LVecBase2f &value);
39
double
noise(
const
LVecBase2d &value);
40
41
INLINE
double
operator ()(
double
x,
double
y);
42
INLINE
float
operator ()(
const
LVecBase2f &value);
43
INLINE
double
operator ()(
const
LVecBase2d &value);
44
45
private
:
46
class
Noise {
47
public
:
48
PerlinNoise2
_noise;
49
double
_amp;
50
};
51
52
typedef
pvector<Noise>
Noises
;
53
Noises
_noises;
54
};
55
56
#include "
stackedPerlinNoise2.I
"
57
58
#endif
stackedPerlinNoise2.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pvector< Noise >
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pvector.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
perlinNoise2.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PerlinNoise2
This class provides an implementation of Perlin noise for 2 variables.
Definition:
perlinNoise2.h:25
StackedPerlinNoise2
Implements a multi-layer PerlinNoise, with one or more high-frequency noise functions added to a lowe...
Definition:
stackedPerlinNoise2.h:25
Generated on Sat Jan 11 2020 15:15:14 for Panda3D by
1.8.17