Random number generator. Stable across platforms and runs for any given seed.
More...
|
| RandomEngine () |
| Construct with random seed.
|
|
| RandomEngine (unsigned seed) |
| Construct with seed.
|
|
| RandomEngine (const ea::string &state) |
| Construct from state.
|
|
void | Load (const ea::string &state) |
| Load state from string.
|
|
ea::string | Save () const |
| Save state as string.
|
|
unsigned | GetUInt () |
| Return random unsigned integer number in range [0, MaxRange) with uniform distribution.
|
|
unsigned | GetUInt (unsigned range) |
| Return random unsigned integer number in range [0, range) with uniform distribution. Range should not exceed MaxRange.
|
|
unsigned | GetUInt (unsigned min, unsigned max) |
| Return random unsigned int in range [min, max) with uniform distribution. Range should not exceed MaxRange.
|
|
int | GetInt (int min, int max) |
| Return random int in range [min, max) with uniform distribution. Range should not exceed MaxRange.
|
|
template<class RandomIter > |
void | Shuffle (RandomIter first, RandomIter last) |
| Shuffle range in random order.
|
|
double | GetDouble () |
| Return random double in range [0, 1] with uniform distribution.
|
|
double | GetDouble (double min, double max) |
| Return random double in range [min, max] with uniform distribution.
|
|
bool | GetBool (float probability) |
| Return random boolean with given probability of returning true.
|
|
float | GetFloat () |
| Return random float in range [0, 1] with uniform distribution.
|
|
float | GetFloat (float min, float max) |
| Return random float in range [min, max] with uniform distribution.
|
|
ea::pair< float, float > | GetStandardNormalFloatPair () |
| Return pair of random floats with standard normal distribution.
|
|
float | GetStandardNormalFloat () |
| Return random float with standard normal distribution.
|
|
float | GetNormalFloat (float mean, float sigma) |
| Return random float with normal distribution.
|
|
Vector2 | GetDirectionVector2 () |
| Return random 2D direction (normalized).
|
|
Vector3 | GetDirectionVector3 () |
| Return random 3D direction (normalized).
|
|
Quaternion | GetQuaternion () |
| Return random quaternion (normalized).
|
|
Vector2 | GetVector2 (const Vector2 &min, const Vector2 &max) |
| Return random 2D vector in 2D volume.
|
|
Vector3 | GetVector3 (const Vector3 &min, const Vector3 &max) |
| Return random 3D vector in 3D volume.
|
|
Vector3 | GetVector3 (const BoundingBox &boundingBox) |
| Return random 3D vector in 3D volume.
|
|
Random number generator. Stable across platforms and runs for any given seed.