Namepsace for all random-generation functions. More...
Functions | |
SP_EXPORT void | seedRandom (bool isTimeBase) |
SP_EXPORT s32 | randInt () |
Returns a random value in the range [0 .. RAND_MAX]. | |
SP_EXPORT s32 | randInt (const s32 Max) |
Returns a random value in the range [0 .. Max]. This value can also be negative. | |
SP_EXPORT s32 | randInt (const s32 Min, const s32 Max) |
Returns a random value in the range [Min .. Max]. These values can also be negative. | |
SP_EXPORT bool | randBool (const u32 Probability) |
Returns true if the specified probability occurs. This is equivalent to "randInt(Probability) == 0". | |
SP_EXPORT f32 | randFloat () |
Returns a random value in the range [0.0 .. 1.0]. | |
SP_EXPORT f32 | randFloat (const f32 Max) |
Returns a floating point random value in the range [0.0 .. Max]. | |
SP_EXPORT f32 | randFloat (const f32 Min, const f32 Max) |
Returns a floating point random value in the range [Min .. Max]. | |
SP_EXPORT video::color | randColor (bool RandAlpha=false) |
Returns a random color. If 'RandAlpha' is false, the alpha channel is always 255. | |
SP_EXPORT dim::vector3df | randVector () |
Returns a random direction vector. This vector is always normalized. |
Namepsace for all random-generation functions.
SP_EXPORT bool sp::math::Randomizer::randBool | ( | const u32 | Probability | ) |
Returns true if the specified probability occurs. This is equivalent to "randInt(Probability) == 0".
SP_EXPORT video::color sp::math::Randomizer::randColor | ( | bool | RandAlpha | ) |
Returns a random color. If 'RandAlpha' is false, the alpha channel is always 255.
SP_EXPORT f32 sp::math::Randomizer::randFloat | ( | const f32 | Min, | |
const f32 | Max | |||
) |
Returns a floating point random value in the range [Min .. Max].
SP_EXPORT f32 sp::math::Randomizer::randFloat | ( | ) |
Returns a random value in the range [0.0 .. 1.0].
SP_EXPORT f32 sp::math::Randomizer::randFloat | ( | const f32 | Max | ) |
Returns a floating point random value in the range [0.0 .. Max].
SP_EXPORT s32 sp::math::Randomizer::randInt | ( | ) |
Returns a random value in the range [0 .. RAND_MAX].
SP_EXPORT s32 sp::math::Randomizer::randInt | ( | const s32 | Min, | |
const s32 | Max | |||
) |
Returns a random value in the range [Min .. Max]. These values can also be negative.
SP_EXPORT s32 sp::math::Randomizer::randInt | ( | const s32 | Max | ) |
Returns a random value in the range [0 .. Max]. This value can also be negative.
SP_EXPORT dim::vector3df sp::math::Randomizer::randVector | ( | ) |
Returns a random direction vector. This vector is always normalized.
SP_EXPORT void sp::math::Randomizer::seedRandom | ( | bool | isTimeBase = true |
) |
Seeds a random to have always other random values when the program starts.
isTimeBase,: | Specifies whether the current time shall be used as the base for further random value generations. |