Nebula
Loading...
Searching...
No Matches
Util.Random Class Reference

Static Public Member Functions

static void Seed (ulong seed)
 Select a specific seed for the RNG.
static void RandomizeSeed ()
 Randomize the seed for the RNG.
static float Range (float min, float max)
 Random float in [min, max).
static int Range (int min, int max)
 Random integer in [min, max).
static Vector3 InUnitSphere ()
 Random vector3 point inside unit sphere.
static float Smooth (float seed)
 Returns a smooth "random" number based on seed.

Properties

static float Value [get]
 Random float in [0, 1).

Static Private Member Functions

static uint Next ()
static uint RotateLeft (uint x, int k)

Static Private Attributes

static uint s0 = 0xA3C59AC3u
static uint s1 = 0x3C6EF372u
static uint s2 = 0xDAA66D2Bu
static uint s3 = 0x78DDE6E4u

Member Function Documentation

◆ InUnitSphere()

Vector3 Util.Random.InUnitSphere ( )
inlinestatic

Random vector3 point inside unit sphere.

Note that this produces a non uniform distribution.

◆ Next()

uint Util.Random.Next ( )
inlinestaticprivate

◆ RandomizeSeed()

void Util.Random.RandomizeSeed ( )
inlinestatic

Randomize the seed for the RNG.

◆ Range() [1/2]

float Util.Random.Range ( float min,
float max )
inlinestatic

Random float in [min, max).

◆ Range() [2/2]

int Util.Random.Range ( int min,
int max )
inlinestatic

Random integer in [min, max).

◆ RotateLeft()

uint Util.Random.RotateLeft ( uint x,
int k )
inlinestaticprivate

◆ Seed()

void Util.Random.Seed ( ulong seed)
inlinestatic

Select a specific seed for the RNG.

◆ Smooth()

float Util.Random.Smooth ( float seed)
inlinestatic

Returns a smooth "random" number based on seed.

Random value will be between approximately -1.0f and 1.0f (not exact!). If seed is increased, the random number will smoothly "slide" towards a new "point".

Member Data Documentation

◆ s0

uint Util.Random.s0 = 0xA3C59AC3u
staticprivate

◆ s1

uint Util.Random.s1 = 0x3C6EF372u
staticprivate

◆ s2

uint Util.Random.s2 = 0xDAA66D2Bu
staticprivate

◆ s3

uint Util.Random.s3 = 0x78DDE6E4u
staticprivate

Property Documentation

◆ Value

float Util.Random.Value
staticget

Random float in [0, 1).


The documentation for this class was generated from the following file:
  • /github/workspace/code/addons/nsharp/NebulaEngine/util/Random.cs