Table of Contents

Core

(NOTE) Contains utility functions for random generation.

Methods Properties Base Classes Derived Classes
BellCurve MaxInteger
Boolean Seed
CoinFlip
DieRoll
DoubleRange
DoubleReal
Integer
Probability
Quaternion
Constructor
Range
RangeExclusiveMax
RangeInclusiveMax
Real
Real2
Real3
Rotation
UnitReal2
UnitReal3
Variance

Properties


MaxInteger : integer

read-only static

Returns the max integer value that can be returned.

var MaxInteger : Integer

Seed : integer

The seed controls what random numbers are generated in a sequence (determanistically) The same seed will always generate the same string of random numbers.

var Seed : Integer

Methods


BellCurve : real

Samples a bell curve with standard normal distribution in the range [0,1] This is equivalent to a Gaussian distribution with standard deviation of 1. |Name|Type|Description| |---|---|---|

function BellCurve() : Real

BellCurve : real

Samples a bell curve with in the range [center - range, center + range] This uses a standard deviation of 1. |Name|Type|Description| |---|---|---| |center|real| | |range|real| |

function BellCurve(center : Real, range : Real) : Real

BellCurve : real

Samples a bell curve in the range [center - range, center + range] with the given standard deviation. Around 68% will lie within the 1st standard deviation. |Name|Type|Description| |---|---|---| |center|real| | |range|real| | |standardDeviation|real| |

function BellCurve(center : Real, range : Real, standardDeviation : Real) : Real

Boolean : boolean

Returns a random boolean value. |Name|Type|Description| |---|---|---|

function Boolean() : Boolean

CoinFlip : boolean

Returns true if the coin flips heads. |Name|Type|Description| |---|---|---|

function CoinFlip() : Boolean

DieRoll : integer

Randomly rolls a number in the range [1, sides]. |Name|Type|Description| |---|---|---| |sides|integer| |

function DieRoll(sides : Integer) : Integer

DoubleRange : doublereal

Name Type Description
doublereal
doublereal
function DoubleRange( : DoubleReal,  : DoubleReal) : DoubleReal

DoubleReal : doublereal

Returns a random double real in the range [0,1]. |Name|Type|Description| |---|---|---|

function DoubleReal() : DoubleReal

Integer : integer

Returns a random integer in the range of [0, MaxInt]. |Name|Type|Description| |---|---|---|

function Integer() : Integer

Probability : boolean

Takes a given probability that we get a true value. |Name|Type|Description| |---|---|---| |probOfTrue|real| |

function Probability(probOfTrue : Real) : Boolean

Quaternion : quaternion

Random unit length quaternion. This is also a unit quaternion. |Name|Type|Description| |---|---|---|

function Quaternion() : Quaternion

Random : Void

constructor

Default constructor (grabs the random seed) |Name|Type|Description| |---|---|---|

function Random()

Random : Void

constructor

Construct a random generator with a specific seed. |Name|Type|Description| |---|---|---| |seed|integer| |

function Random(seed : Integer)

Range : real

A random Real in the range [min,max]. |Name|Type|Description| |---|---|---| |min|real| | |max|real| |

function Range(min : Real, max : Real) : Real

RangeExclusiveMax : integer

Integer in the range [min, max]. |Name|Type|Description| |---|---|---| |min|integer| | |max|integer| |

function RangeExclusiveMax(min : Integer, max : Integer) : Integer

RangeInclusiveMax : integer

Integer in the range [min, max) |Name|Type|Description| |---|---|---| |min|integer| | |max|integer| |

function RangeInclusiveMax(min : Integer, max : Integer) : Integer

Real : real

Returns a random real in the range [0,1]. |Name|Type|Description| |---|---|---|

function Real() : Real

Real2 : real2

Randomly generates a Real2 with its length between min and max. |Name|Type|Description| |---|---|---| |minLength|real| | |maxLength|real| |

function Real2(minLength : Real, maxLength : Real) : Real2

Real3 : real3

Randomly generates a Real3 with its length between min and max. |Name|Type|Description| |---|---|---| |minLength|real| | |maxLength|real| |

function Real3(minLength : Real, maxLength : Real) : Real3

Rotation : quaternion

Random rotation quaternion. This is the same as calling Quaternion() |Name|Type|Description| |---|---|---|

function Rotation() : Quaternion

UnitReal2 : real2

Generates a unit length Real2. |Name|Type|Description| |---|---|---|

function UnitReal2() : Real2

UnitReal3 : real3

Generates a unit length Real3. |Name|Type|Description| |---|---|---|

function UnitReal3() : Real3

Variance : doublereal

Integer in the range [base - variance, base + variance]. |Name|Type|Description| |---|---|---| ||doublereal| | ||doublereal| |

function Variance( : DoubleReal,  : DoubleReal) : DoubleReal

Variance : integer

Integer in the range [base - variance, base + variance]. |Name|Type|Description| |---|---|---| |base|integer| | |variance|integer| |

function Variance(base : Integer, variance : Integer) : Integer

Variance : real

Returns a number in the range [base - variance, base + variance]. |Name|Type|Description| |---|---|---| |base|real| | |variance|real| |

function Variance(base : Real, variance : Real) : Real