Module maths

Source
Expand description

Basic math types, traits and methods.

Structs§

Angle
An Angle between -PI and PI.
Mat4
A 4x4 matrix.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.

Traits§

Matrix
Matrix-methods for 4x4 arrays.
Vector
Values that can be converted to a vector.

Functions§

approach
Mutates source_value to approach target_value at the rate_of_change. Effectively a lerp that writes to source.
clamp
Returns the given value limited to the bounds min and max.
lerp
Interpolates between values. Returns source_value for ratio = 0.0 and target_value for ratio = 1.0.
max
Returns the greater of the two given values.
min
Returns the smaller of the two given values.