Panda3D
 All Classes Functions Variables Enumerations
perlinNoise.I
00001 // Filename: perlinNoise.I
00002 // Created by:  drose (05Oct05)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: PerlinNoise::fade
00018 //       Access: Protected, Static
00019 //  Description: Returns a smooth interpolation spline from 0 .. 1
00020 //               for t.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE double PerlinNoise::
00023 fade(double t) { 
00024   //  return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
00025   return (3.0 - 2.0 * t) * t * t;
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: PerlinNoise::lerp
00030 //       Access: Protected, Static
00031 //  Description: Returns the smoothly lerped value from a to b.
00032 ////////////////////////////////////////////////////////////////////
00033 INLINE double PerlinNoise::
00034 lerp(double t, double a, double b) { 
00035   return a + t * (b - a); 
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: PerlinNoise::get_seed
00040 //       Access: Published
00041 //  Description: Returns a unique seed value based on the seed value
00042 //               passed to this PerlinNoise object (and on its current
00043 //               state).
00044 ////////////////////////////////////////////////////////////////////
00045 INLINE unsigned long PerlinNoise::
00046 get_seed() {
00047   return _randomizer.get_seed();
00048 }
 All Classes Functions Variables Enumerations