Panda3D
perlinNoise.I
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.I
10  * @author drose
11  * @date 2005-10-05
12  */
13 
14 /**
15  * Returns a smooth interpolation spline from 0 .. 1 for t.
16  */
17 INLINE double PerlinNoise::
18 fade(double t) {
19  // return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
20  return (3.0 - 2.0 * t) * t * t;
21 }
22 
23 /**
24  * Returns the smoothly lerped value from a to b.
25  */
26 INLINE double PerlinNoise::
27 lerp(double t, double a, double b) {
28  return a + t * (b - a);
29 }
30 
31 /**
32  * Returns a unique seed value based on the seed value passed to this
33  * PerlinNoise object (and on its current state).
34  */
35 INLINE unsigned long PerlinNoise::
37  return _randomizer.get_seed();
38 }
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:82
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:36