Extension methods for the RNGSession struct to provide additional random number generation functionality for quaternions, colors, and vectors in various geometric distributions. More...
Static Public Member Functions | |
static ColorRGBA | ColorHSV (this ref RNGSession rng) |
Generates a random color using HSV values, converted to RGB. More... | |
static FPVector2 | InUnitCircle (this ref RNGSession rng, bool uniform=false) |
Returns a random 2D vector inside the unit circle. More... | |
static FPVector3 | InUnitSphere (this ref RNGSession rng, bool uniform=false) |
Returns a random point inside the unit sphere. More... | |
static FPVector2 | OnUnitCircle (this ref RNGSession rng) |
Returns a random point on the perimeter of the unit circle. More... | |
static FPVector3 | OnUnitSphere (this ref RNGSession rng, bool uniform=false) |
Returns a random point on the surface of the unit sphere. More... | |
static FPQuaternion | Rotation (this ref RNGSession rng) |
Generates a random quaternion with each component in the range [0,1]. More... | |
Extension methods for the RNGSession struct to provide additional random number generation functionality for quaternions, colors, and vectors in various geometric distributions.
|
inlinestatic |
Generates a random quaternion with each component in the range [0,1].
rng | The random number generator session. |
|
inlinestatic |
Generates a random color using HSV values, converted to RGB.
rng | The random number generator session. |
|
inlinestatic |
Returns a random 2D vector inside the unit circle.
rng | The random number generator session. |
uniform | If true, distribution is uniform over the area. Note: This requires an additional square root operation which has a minor performance cost but provides better distribution. |
|
inlinestatic |
Returns a random point on the perimeter of the unit circle.
rng | The random number generator session. |
|
inlinestatic |
Returns a random point inside the unit sphere.
rng | The random number generator session. |
uniform | If true, distribution is uniform over the volume. Note: This requires an additional cube root calculation which has a higher performance cost but provides a statistically correct distribution of points throughout the volume. |
|
inlinestatic |
Returns a random point on the surface of the unit sphere.
rng | The random number generator session. |
uniform | If true, points are uniformly distributed over the surface. Note: The uniform distribution uses a different algorithm which has a minor performance impact but ensures points are not clustered at the poles of the sphere. |