GLUS
Macros | Functions
glus_random.c File Reference
#include "GL/glus.h"

Macros

#define GLUS_UNIFORM_RANDOM_BIAS   0.0000001f
 

Functions

GLUSvoid GLUSAPIENTRY glusRandomSetSeed (const GLUSuint seed)
 Initializes the random generator. More...
 
GLUSfloat GLUSAPIENTRY glusRandomUniformf (const GLUSfloat start, const GLUSfloat end)
 Returns a uniform distributed random floating point value in the given range. More...
 
GLUSfloat GLUSAPIENTRY glusRandomNormalf (const GLUSfloat mean, const GLUSfloat standardDeviation)
 Returns a normal distributed random floating point value. More...
 
GLUSboolean GLUSAPIENTRY glusRandomHammersleyf (GLUSfloat result[2], const GLUSuint sample, const GLUSubyte m)
 Samples two floating point values from a Hammersley point set. More...
 

Macro Definition Documentation

#define GLUS_UNIFORM_RANDOM_BIAS   0.0000001f

Function Documentation

GLUSboolean GLUSAPIENTRY glusRandomHammersleyf ( GLUSfloat  result[2],
const GLUSuint  sample,
const GLUSubyte  m 
)

Samples two floating point values from a Hammersley point set.

Parameters
resultThe resulting random values.
sampleThe sample to take. Has to be in the range 0 <= sample < 2^m.
mOrder m, which allows 2^m samples. Has to be in the range 0 < m <= 32.
Returns
GLUS_TRUE, if sampling was successful.
GLUSfloat GLUSAPIENTRY glusRandomNormalf ( const GLUSfloat  mean,
const GLUSfloat  standardDeviation 
)

Returns a normal distributed random floating point value.

Parameters
meanMean.
standardDeviationStandard deviation.
Returns
The random value.
GLUSvoid GLUSAPIENTRY glusRandomSetSeed ( const GLUSuint  seed)

Initializes the random generator.

Parameters
seedNumber for initializing the pseudo-random number generator.
GLUSfloat GLUSAPIENTRY glusRandomUniformf ( const GLUSfloat  start,
const GLUSfloat  end 
)

Returns a uniform distributed random floating point value in the given range.

Parameters
startSmallest possible generated value (inclusive).
endLargest possible generated value (inclusive).
Returns
The random value.