// perlin.hh
// This source code file (perlin.hh) originated from libnoise (noisegen.h).
// It was drastically hacked/reduced/optimized by Jim Brooks [jimb].
//
//------------------------------------------------------------------------------
//
// noisegen.h
//
// Copyright (C) 2003, 2004 Jason Bevins
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or (at
// your option) any later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
// License (COPYING.txt) for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// The developer's email is jlbezigvins@gmzigail.com (for great email, take
// off every 'zig'.)
//
//------------------------------------------------------------------------------

#ifndef LIBNOISE_PERLIN_HH
#define LIBNOISE_PERLIN_HH 1

#include <math.h>
#include "basictypes.hh"

namespace noise
{
  /// This is the 3D Perlin noise function.  (x,y,z) are the noise coords.
  /// The frequency (octave) can be scaled by scaling the noise coords.
  ///
  /// Note: libnoise documents return value in range {-1,...,+1}
  /// but have slightly out-of-range values such as -1.1 can occur.
  ///
  /// ....................................................................
  ///
  /// Generates a gradient-coherent-noise value from the coordinates of a
  /// three-dimensional input value.
  ///
  /// @param x The @a x coordinate of the input value.
  /// @param y The @a y coordinate of the input value.
  /// @param z The @a z coordinate of the input value.
  ///
  /// @returns The generated gradient-coherent-noise value.
  ///
  /// The return value ranges from -1.0 to +1.0.
  ///
  /// For an explanation of the difference between <i>gradient</i> noise and
  /// <i>value</i> noise, see the comments for the GradientNoise3D() function.
  ///
  //float GradientCoherentNoise3D( float x, float y, float z ); // original name

  float PerlinNoise( float x, float y, float z );

} // namespace noise

#endif // LIBNOISE_PERLIN_HH
