Extends the built-in C# Random class with methods for generating floats, vectors, and quaternions. More...
Public Member Functions | |
| ksRandom () | |
| Constructor. Initializes the seed to the microsecond timestamp. More... | |
| ksRandom (int seed) | |
| Constructor. More... | |
| float | NextFloat () |
| Random value between 0 (inclusive) and 1 (exclusive). More... | |
| float | NextFloat (float min, float max) |
| Returns a random float within a range. More... | |
| ksVector2 | NextUnitVector2 () |
| Random vector2 with magnitude 1. More... | |
| ksVector2 | NextVector2 () |
| Random vector3 with magnitude less than 1. More... | |
| ksVector2 | NextVector2 (float minMagnitude, float maxMagnitude) |
| Returns a random vector2 with magnitude within a range. More... | |
| ksVector3 | NextUnitVector3 () |
| Random vector3 with magnitude 1. More... | |
| ksVector3 | NextVector3 () |
| Random vector3 with magnitude less than 1. More... | |
| ksVector3 | NextVector3 (float minMagnitude, float maxMagnitude) |
| Returns a random vector3 with magnitude within a range. More... | |
| ksQuaternion | NextQuaternion () |
| Random quaternion. More... | |
Properties | |
| int | Seed [get] |
| Initial seed. More... | |
Extends the built-in C# Random class with methods for generating floats, vectors, and quaternions.
| KS.Reactor.ksRandom.ksRandom | ( | ) |
Constructor. Initializes the seed to the microsecond timestamp.
| KS.Reactor.ksRandom.ksRandom | ( | int | seed | ) |
Constructor.
| seed | Seed for pseudo-random sequence. |
| float KS.Reactor.ksRandom.NextFloat | ( | ) |
Random value between 0 (inclusive) and 1 (exclusive).
| float KS.Reactor.ksRandom.NextFloat | ( | float | min, |
| float | max | ||
| ) |
Returns a random float within a range.
| min | Min value (inclusive). |
| max | Max value (exclusive) |
| ksQuaternion KS.Reactor.ksRandom.NextQuaternion | ( | ) |
Random quaternion.
| ksVector2 KS.Reactor.ksRandom.NextUnitVector2 | ( | ) |
Random vector2 with magnitude 1.
| ksVector3 KS.Reactor.ksRandom.NextUnitVector3 | ( | ) |
Random vector3 with magnitude 1.
| ksVector2 KS.Reactor.ksRandom.NextVector2 | ( | ) |
Random vector3 with magnitude less than 1.
| ksVector2 KS.Reactor.ksRandom.NextVector2 | ( | float | minMagnitude, |
| float | maxMagnitude | ||
| ) |
Returns a random vector2 with magnitude within a range.
| minMagnitude | Min magnitude (inclusive). |
| maxMagnitude | Max magnitude (exclusive). |
| ksVector3 KS.Reactor.ksRandom.NextVector3 | ( | ) |
Random vector3 with magnitude less than 1.
| ksVector3 KS.Reactor.ksRandom.NextVector3 | ( | float | minMagnitude, |
| float | maxMagnitude | ||
| ) |
Returns a random vector3 with magnitude within a range.
| minMagnitude | Min magnitude(inclusive). |
| maxMagnitude | Max magnitude(exclusive). |
|
get |
Initial seed.