vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
math_aux.cpp File Reference
#include <cstdlib>
#include <vreckoAP/Nature/Clouds/math_aux.h>

Functions

unsigned int randGauss (unsigned int number, unsigned int n)
 
float randFloat (void)
 
float interpolationLinear (float a, float b, float t)
 
void clampColor (osg::Vec4f &color, float maximum)
 

Detailed Description

Author
Jakub Kroupal (original Atmospheric plug-in)
Rastislav Tisovcik (revised Clouds ability)
Version
2.0
Date
2008 (Atmospheric), January 2011 - February 2011 (Clouds)

Function Documentation

void clampColor ( osg::Vec4f &  color,
float  maximum 
)

Clamps the color in case some of its values are larger than the given maximum.

Parameters
colorColor to be clamped.
maximumThreshold value; color channels larger than maximum will be clamped to it, smaller values will be preserved.
float interpolationLinear ( float  a,
float  b,
float  t 
)

Linear interpolation of two values.

Parameters
aThe first value to interpolate.
bThe second value to interpolate.
tValue on the interval. T = 0.0 returns as a result value A, T = 1.0 returns as a result value B
float randFloat ( void  )

Returns a pseudo-random float value from the interval <0, 1.0)

Returns
Pseudo-random float value
unsigned int randGauss ( unsigned int  cislo,
unsigned int  n 
)

Returns a pseudo-random unsigned integer value based on Gauss distribution

Parameters
[in]numberMaximum value of the number
[in]nNumber of iterations
Returns
Pseudo-random number based on Gauss distribution