MathUtils

Summary

Methods

Method Returns
GetRandom(from: float, to: float) float
GetRandomInt(from: int, to: int) int
GetYPRFromULF(up: Vec3, left: Vec3, forward: Vec3) Vec3 | nil
GetTransformFromYPR(yaw: float, pitch: float, roll: float) LinearTransform
Approximately(a: float, b: float) bool
Clamp(value: float, min: float, max: float) float
Round(value: float) float
FNVHash(text: string) int
Lerp(from: float, to: float, t: float) float
RandomGuid() Guid

Methods

GetRandom

GetRandom(from: float, to: float): float

Parameters

Name Type Description
from float
to float

Returns

Type Description
float

GetRandomInt

GetRandomInt(from: int, to: int): int

Parameters

Name Type Description
from int
to int

Returns

Type Description
int

GetYPRFromULF

GetYPRFromULF(up: Vec3, left: Vec3, forward: Vec3): Vec3 | nil

Parameters

Name Type Description
up Vec3
left Vec3
forward Vec3

Returns

Type Description
Vec3 | nil

GetTransformFromYPR

GetTransformFromYPR(yaw: float, pitch: float, roll: float): LinearTransform

Parameters

Name Type Description
yaw float
pitch float
roll float

Returns

Type Description
LinearTransform

Approximately

Approximately(a: float, b: float): bool

Parameters

Name Type Description
a float
b float

Returns

Type Description
bool

Clamp

Clamp(value: float, min: float, max: float): float

Parameters

Name Type Description
value float
min float
max float

Returns

Type Description
float

Round

Round(value: float): float

Parameters

Name Type Description
value float

Returns

Type Description
float

FNVHash

FNVHash(text: string): int

Parameters

Name Type Description
text string

Returns

Type Description
int

Lerp

Lerp(from: float, to: float, t: float): float

Parameters

Name Type Description
from float
to float
t float

Returns

Type Description
float

RandomGuid

RandomGuid(): Guid

Returns

Type Description
Guid
Last modified September 8, 2020: Document MathUtils:RandomGuid method (36e8ac11)