csRandomFloatGen Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
csRandomFloatGen Class Reference

Fast simple random number generator for floating point values. More...

`#include <csutil/floatrand.h>`

List of all members.

## Public Member Functions
| csRandomFloatGen ()
| Initialize the random number generator using current time().
| csRandomFloatGen (unsigned int seed)
| Initialize the random number generator using given seed.
float | Get ()
| Get a floating-point random number in range 0 <= num < 1.
float | Get (float max)
| Get a floating point random number in range 0 <= num < `max`.
float | Get (float min, float max)
| Get a floating point random number in range `min` <= num < `max`.
float | GetAngle ()
| Get a random angle in range 0 <= num < 2*PI radians.
void | Initialize ()
| Initialize the RNG using current time() as the seed value.
void | Initialize (unsigned int new_seed)
| Initialize the RNG using the supplied seed value.

## Detailed Description

Fast simple random number generator for floating point values.

Definition at line 34 of file floatrand.h.

## Constructor & Destructor Documentation

csRandomFloatGen::csRandomFloatGen | ( |  | ) | `[inline]`

Initialize the random number generator using current time().

Definition at line 41 of file floatrand.h.

csRandomFloatGen::csRandomFloatGen | ( | unsigned int | seed | ) | `[inline]`

Initialize the random number generator using given seed.

Definition at line 44 of file floatrand.h.

## Member Function Documentation

float csRandomFloatGen::Get | ( |  | ) | `[inline]`

Get a floating-point random number in range 0 <= num < 1.

Definition at line 54 of file floatrand.h.

float csRandomFloatGen::Get | ( | float | max | ) | `[inline]`

Get a floating point random number in range 0 <= num < `max`.

Definition at line 69 of file floatrand.h.

float csRandomFloatGen::Get | ( | float | min,
|  | float | max
| ) |  | `[inline]`

Get a floating point random number in range `min` <= num < `max`.

Definition at line 75 of file floatrand.h.

float csRandomFloatGen::GetAngle | ( |  | ) | `[inline]`

Get a random angle in range 0 <= num < 2*PI radians.

Definition at line 82 of file floatrand.h.

void csRandomFloatGen::Initialize | ( |  | ) |

Initialize the RNG using current time() as the seed value.

void csRandomFloatGen::Initialize | ( | unsigned int | new_seed | ) | `[inline]`

Initialize the RNG using the supplied seed value.

Definition at line 50 of file floatrand.h.

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

- csutil/floatrand.h