Cyclone Cyclone: cyclone::Random Class Reference

cyclone::Random Class Reference

Keeps track of one random stream: i.e. More...

#include <random.h>

List of all members.

Public Member Functions

 Random ()
 Creates a new random number stream with a seed based on timing data.
 Random (unsigned seed)
 Creates a new random stream with the given seed.
void seed (unsigned seed)
 Sets the seed value for the random stream.
unsigned randomBits ()
 Returns the next random bitstring from the stream.
real randomReal ()
 Returns a random floating point number between 0 and 1.
real randomReal (real scale)
 Returns a random floating point number between 0 and scale.
real randomReal (real min, real max)
 Returns a random floating point number between min and max.
unsigned randomInt (unsigned max)
 Returns a random integer less than the given value.
real randomBinomial (real scale)
 Returns a random binomially distributed number between -scale and +scale.
Vector3 randomVector (real scale)
 Returns a random vector where each component is binomially distributed in the range (-scale to scale) [mean = 0.0f].
Vector3 randomVector (const Vector3 &scale)
 Returns a random vector where each component is binomially distributed in the range (-scale to scale) [mean = 0.0f], where scale is the corresponding component of the given vector.
Vector3 randomVector (const Vector3 &min, const Vector3 &max)
 Returns a random vector in the cube defined by the given minimum and maximum vectors.
Vector3 randomXZVector (real scale)
 Returns a random vector where each component is binomially distributed in the range (-scale to scale) [mean = 0.0f], except the y coordinate which is zero.
Quaternion randomQuaternion ()
 Returns a random orientation (i.e.


Detailed Description

Keeps track of one random stream: i.e.

a seed and its output. This is used to get random numbers. Rather than a funcion, this allows there to be several streams of repeatable random numbers at the same time. Uses the RandRotB algorithm.


Constructor & Destructor Documentation

cyclone::Random::Random  ) 
 

Creates a new random number stream with a seed based on timing data.

cyclone::Random::Random unsigned  seed  ) 
 

Creates a new random stream with the given seed.


Member Function Documentation

real cyclone::Random::randomBinomial real  scale  ) 
 

Returns a random binomially distributed number between -scale and +scale.

unsigned cyclone::Random::randomBits  ) 
 

Returns the next random bitstring from the stream.

This is the fastest method.

unsigned cyclone::Random::randomInt unsigned  max  ) 
 

Returns a random integer less than the given value.

Quaternion cyclone::Random::randomQuaternion  ) 
 

Returns a random orientation (i.e.

normalized) quaternion.

real cyclone::Random::randomReal real  min,
real  max
 

Returns a random floating point number between min and max.

real cyclone::Random::randomReal real  scale  ) 
 

Returns a random floating point number between 0 and scale.

real cyclone::Random::randomReal  ) 
 

Returns a random floating point number between 0 and 1.

Vector3 cyclone::Random::randomVector const Vector3 min,
const Vector3 max
 

Returns a random vector in the cube defined by the given minimum and maximum vectors.

The probability is uniformly distributed in this region.

Vector3 cyclone::Random::randomVector const Vector3 scale  ) 
 

Returns a random vector where each component is binomially distributed in the range (-scale to scale) [mean = 0.0f], where scale is the corresponding component of the given vector.

Vector3 cyclone::Random::randomVector real  scale  ) 
 

Returns a random vector where each component is binomially distributed in the range (-scale to scale) [mean = 0.0f].

Vector3 cyclone::Random::randomXZVector real  scale  ) 
 

Returns a random vector where each component is binomially distributed in the range (-scale to scale) [mean = 0.0f], except the y coordinate which is zero.

void cyclone::Random::seed unsigned  seed  ) 
 

Sets the seed value for the random stream.


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