OGRE  1.9.0
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 (unsigned long definedSeed)
 Constructor with a by seed defined permutation table.
 
 SimplexNoise (void)
 Constructor with a random permutation table.
 
long getSeed (void) const
 Gets the current seed.
 
Real noise (Real xIn, Real yIn, Real zIn) const
 3D noise function.
 

Private Member Functions

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

Private Attributes

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

Static Private Attributes

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

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

◆ SimplexNoise() [1/2]

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

Constructor with a random permutation table.

◆ SimplexNoise() [2/2]

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

Constructor with a by seed defined permutation table.

Parameters
definedSeedThe seed to use.

Member Function Documentation

◆ dot()

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

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.

◆ getSeed()

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

Gets the current seed.

Returns
The current seed.

◆ init()

void Ogre::Volume::SimplexNoise::init ( unsigned long definedSeed)
private

Initializes the SimplexNoise instance.

◆ noise()

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.

Referenced by Ogre::Volume::CSGNoiseSource::getInternalValue().

◆ random()

unsigned long Ogre::Volume::SimplexNoise::random ( void )
private

Member Data Documentation

◆ F3

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

Skewing and unskewing factor for 3 dimensions.

Definition at line 47 of file OgreVolumeSimplexNoise.h.

◆ G3

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

Skewing and unskewing factor for 3 dimensions.

Definition at line 50 of file OgreVolumeSimplexNoise.h.

◆ mSeed

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

Random seed.

Definition at line 53 of file OgreVolumeSimplexNoise.h.

◆ perm

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

Permutation table.

Definition at line 56 of file OgreVolumeSimplexNoise.h.

◆ permMod12

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: