Panda3D
perlinNoise.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 perlinNoise.h
10  * @author drose
11  * @date 2005-10-05
12  */
13 
14 #ifndef PERLINNOISE_H
15 #define PERLINNOISE_H
16 
17 #include "pandabase.h"
18 #include "pvector.h"
19 #include "vector_int.h"
20 #include "luse.h"
21 #include "randomizer.h"
22 
23 /**
24  * This is the base class for PerlinNoise2 and PerlinNoise3, different
25  * dimensions of Perlin noise implementation. The base class just collects
26  * the common functionality.
27  */
28 class EXPCL_PANDA_MATHUTIL PerlinNoise {
29 protected:
30  PerlinNoise(int table_size, unsigned long seed);
31  PerlinNoise(const PerlinNoise &copy);
32  void operator = (const PerlinNoise &copy);
33 
34  INLINE static double fade(double t);
35  INLINE static double lerp(double t, double a, double b);
36 
37 PUBLISHED:
38  INLINE unsigned long get_seed();
39 
40 protected:
41  int _table_size;
42  int _table_size_mask;
43 
44  Randomizer _randomizer;
45 
46  typedef vector_int Index;
47  Index _index;
48 };
49 
50 #include "perlinNoise.I"
51 
52 #endif
This is the base class for PerlinNoise2 and PerlinNoise3, different dimensions of Perlin noise implem...
Definition: perlinNoise.h:28
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A handy class to return random numbers.
Definition: randomizer.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.