Panda3D
 All Classes Functions Variables Enumerations
perlinNoise.I
1 // Filename: perlinNoise.I
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: PerlinNoise::fade
18 // Access: Protected, Static
19 // Description: Returns a smooth interpolation spline from 0 .. 1
20 // for t.
21 ////////////////////////////////////////////////////////////////////
22 INLINE double PerlinNoise::
23 fade(double t) {
24  // return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
25  return (3.0 - 2.0 * t) * t * t;
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: PerlinNoise::lerp
30 // Access: Protected, Static
31 // Description: Returns the smoothly lerped value from a to b.
32 ////////////////////////////////////////////////////////////////////
33 INLINE double PerlinNoise::
34 lerp(double t, double a, double b) {
35  return a + t * (b - a);
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: PerlinNoise::get_seed
40 // Access: Published
41 // Description: Returns a unique seed value based on the seed value
42 // passed to this PerlinNoise object (and on its current
43 // state).
44 ////////////////////////////////////////////////////////////////////
45 INLINE unsigned long PerlinNoise::
47  return _randomizer.get_seed();
48 }
unsigned long get_seed()
Returns a unique seed value based on the seed value passed to this Randomizer object (and on its curr...
Definition: randomizer.I:102
unsigned long get_seed()
Returns a unique seed value based on the seed value passed to this PerlinNoise object (and on its cur...
Definition: perlinNoise.I:46