Panda3D
 All Classes Functions Variables Enumerations
perlinNoise3.h
1 // Filename: perlinNoise3.h
2 // Created by: drose (05Oct05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PERLINNOISE3_H
16 #define PERLINNOISE3_H
17 
18 #include "pandabase.h"
19 #include "perlinNoise.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : PerlinNoise3
23 // Description : This class provides an implementation of Perlin noise
24 // for 3 variables. This code is loosely based on the
25 // reference implementation at
26 // http://mrl.nyu.edu/~perlin/noise/ .
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_PANDA_MATHUTIL PerlinNoise3 : public PerlinNoise {
29 PUBLISHED:
30  INLINE PerlinNoise3();
31  INLINE PerlinNoise3(double sx, double sy, double sz,
32  int table_size = 256, unsigned long seed = 0);
33  INLINE PerlinNoise3(const PerlinNoise3 &copy);
34  INLINE void operator = (const PerlinNoise3 &copy);
35 
36  INLINE void set_scale(double scale);
37  INLINE void set_scale(double sx, double sy, double sz);
38  INLINE void set_scale(const LVecBase3f &scale);
39  INLINE void set_scale(const LVecBase3d &scale);
40 
41  INLINE double noise(double x, double y, double z) const;
42  INLINE float noise(const LVecBase3f &value) const;
43  double noise(const LVecBase3d &value) const;
44 
45  INLINE double operator ()(double x, double y, double z) const;
46  INLINE float operator ()(const LVecBase3f &value) const;
47  INLINE double operator ()(const LVecBase3d &value) const;
48 
49 private:
50  void init_unscaled_xform();
51  INLINE static double grad(int hash, double x, double y, double z);
52 
53 private:
54  LMatrix4d _unscaled_xform;
55  LMatrix4d _input_xform;
56 };
57 
58 #include "perlinNoise3.I"
59 
60 #endif
61 
This is the base class for PerlinNoise2 and PerlinNoise3, different dimensions of Perlin noise implem...
Definition: perlinNoise.h:31
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
This class provides an implementation of Perlin noise for 3 variables.
Definition: perlinNoise3.h:28
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:1455