OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::Volume::SimplexNoise Class Reference

Simplex Noise ported from public domain Java Implementation http://webstaff.itn.liu.se/~stegu/simplexnoise/SimplexNoise.java Thanks Stefan Gustavson! More...

#include <OgreVolumeSimplexNoise.h>

Public Member Functions

 SimplexNoise (void)
 Constructor with a random permutation table. More...
 
 SimplexNoise (unsigned long definedSeed)
 Constructor with a by seed defined permutation table. More...
 
long getSeed (void) const
 Gets the current seed. More...
 
Real noise (Real xIn, Real yIn, Real zIn) const
 3D noise function. More...
 

Private Member Functions

Real dot (const Vector3 &g, Real x, Real y, Real z) const
 Dot product of a gradient with the given values. More...
 
void init (unsigned long definedSeed)
 Initializes the SimplexNoise instance. More...
 
unsigned long random (void)
 

Private Attributes

long mSeed
 Random seed. More...
 
short perm [512]
 Permutation table. More...
 
short permMod12 [512]
 Permutation table modulo 12. More...
 

Static Private Attributes

static Real F3
 Skewing and unskewing factor for 3 dimensions. More...
 
static Real G3
 Skewing and unskewing factor for 3 dimensions. More...
 

Detailed Description

Simplex Noise ported from public domain Java Implementation http://webstaff.itn.liu.se/~stegu/simplexnoise/SimplexNoise.java Thanks Stefan Gustavson!

Definition at line 42 of file OgreVolumeSimplexNoise.h.

Constructor & Destructor Documentation

Ogre::Volume::SimplexNoise::SimplexNoise ( void  )

Constructor with a random permutation table.

Ogre::Volume::SimplexNoise::SimplexNoise ( unsigned long  definedSeed)

Constructor with a by seed defined permutation table.

Parameters
definedSeedThe seed to use.

Member Function Documentation

Real Ogre::Volume::SimplexNoise::dot ( const Vector3 g,
Real  x,
Real  y,
Real  z 
) const
inlineprivate

Dot product of a gradient with the given values.

Parameters
gThe gradient.
xThe first value.
yThe second value.
zThe third value.
Returns
The dot product.

Definition at line 79 of file OgreVolumeSimplexNoise.h.

References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

long Ogre::Volume::SimplexNoise::getSeed ( void  ) const

Gets the current seed.

Returns
The current seed.
void Ogre::Volume::SimplexNoise::init ( unsigned long  definedSeed)
private

Initializes the SimplexNoise instance.

Real Ogre::Volume::SimplexNoise::noise ( Real  xIn,
Real  yIn,
Real  zIn 
) const

3D noise function.

Parameters
xInThe first dimension parameter.
yInThe second dimension parameter.
zInThe third dimension parameter.
Returns
The noise value.
unsigned long Ogre::Volume::SimplexNoise::random ( void  )
private

Member Data Documentation

Real Ogre::Volume::SimplexNoise::F3
staticprivate

Skewing and unskewing factor for 3 dimensions.

Definition at line 47 of file OgreVolumeSimplexNoise.h.

Real Ogre::Volume::SimplexNoise::G3
staticprivate

Skewing and unskewing factor for 3 dimensions.

Definition at line 50 of file OgreVolumeSimplexNoise.h.

long Ogre::Volume::SimplexNoise::mSeed
private

Random seed.

Definition at line 53 of file OgreVolumeSimplexNoise.h.

short Ogre::Volume::SimplexNoise::perm[512]
private

Permutation table.

Definition at line 56 of file OgreVolumeSimplexNoise.h.

short Ogre::Volume::SimplexNoise::permMod12[512]
private

Permutation table modulo 12.

Definition at line 59 of file OgreVolumeSimplexNoise.h.


The documentation for this class was generated from the following file: