CrystalSpace

Public API Reference

CS::Math::Noise Namespace Reference

Noise generation and utilities. More...

Namespaces

namespace  Model
 

Geometric models for noise generation.


namespace  Module
 

Noise modules for the combination of noise functions.


Enumerations

enum  NoiseQuality { QUALITY_FAST = 0, QUALITY_STD = 1, QUALITY_BEST = 2 }
 

Enumerates the noise quality.

More...

Functions

int ClampValue (int value, int lowerBound, int upperBound)
 Clamps a value onto a clamping range.
double CubicInterp (double n0, double n1, double n2, double n3, double a)
 Performs cubic interpolation between two values bound between two other values.
template<class T >
GetMax (const T &a, const T &b)
 Returns the maximum of two values.
template<class T >
GetMin (const T &a, const T &b)
 Returns the minimum of two values.
double GradientCoherentNoise3D (double x, double y, double z, int seed=0, NoiseQuality noiseQuality=QUALITY_STD)
 Generates a gradient-coherent-noise value from the coordinates of a three-dimensional input value.
double GradientNoise3D (double fx, double fy, double fz, int ix, int iy, int iz, int seed=0)
 Generates a gradient-noise value from the coordinates of a three-dimensional input value and the integer coordinates of a nearby three-dimensional value.
int IntValueNoise3D (int x, int y, int z, int seed=0)
 Generates an integer-noise value from the coordinates of a three-dimensional input value.
void LatLonToXYZ (double lat, double lon, double &x, double &y, double &z)
 Converts latitude/longitude coordinates on a unit sphere into 3D Cartesian coordinates.
double LinearInterp (double n0, double n1, double a)
 Performs linear interpolation between two values.
double MakeInt32Range (double n)
 Modifies a floating-point value so that it can be stored in a CS::Math::Noise::int32 variable.
double SCurve3 (double a)
 Maps a value onto a cubic S-curve.
double SCurve5 (double a)
 Maps a value onto a quintic S-curve.
template<class T >
void SwapValues (T &a, T &b)
 Swaps two values.
double ValueCoherentNoise3D (double x, double y, double z, int seed=0, NoiseQuality noiseQuality=QUALITY_STD)
 Generates a value-coherent-noise value from the coordinates of a three-dimensional input value.
double ValueNoise3D (int x, int y, int z, int seed=0)
 Generates a value-noise value from the coordinates of a three-dimensional input value.

Variables

const double DEG_TO_RAD = PI / 180.0
 Converts an angle from degrees to radians.
const double RAD_TO_DEG = 1.0 / DEG_TO_RAD
 Converts an angle from radians to degrees.
const double SQRT_2 = 1.4142135623730950488
 Pi.
const double SQRT_3 = 1.7320508075688772935
 Square root of 3.

Detailed Description

Noise generation and utilities.

Objects from this namespace use the libnoise library, see http://libnoise.sourceforge.net for more information.


Function Documentation

int CS::Math::Noise::ClampValue ( int  value,
int  lowerBound,
int  upperBound 
) [inline]

Clamps a value onto a clamping range.

Parameters:
value The value to clamp.
lowerBound The lower bound of the clamping range.
upperBound The upper bound of the clamping range.
Returns:
  • value if value lies between lowerBound and upperBound.
  • lowerBound if value is less than lowerBound.
  • upperBound if value is greater than upperBound.

This function does not modify any parameters.

Definition at line 42 of file misc.h.


Generated for Crystal Space 2.1 by doxygen 1.6.1