HELIXMath
A table containing useful and aux Math functions.
🗿Static Class
This is a Static Class. Access it's methods directly with
.
. It's not possible to spawn new instances.Examples​
local axis = HELIXMath.ClampAxis(720)
Static Functions​
Returns | Name | Description | |
---|---|---|---|
number | Round | Rounds a number | |
number | Clamp | Clamps a number | |
number | ClampAxis | Clamps an angle to the range of [0, 360] | |
number | NormalizeAxis | Clamps an angle to the range of [-180, 180] | |
Vector, Rotator | RelativeTo | Calculates the location and rotation relative to an actor | |
number | FInterpTo | Interpolate number from Current to Target | |
Rotator | RInterpTo | Interpolate Rotator from Current to Target | |
Rotator | RInterpConstantTo | Interpolate Rotator from Current to Target with a constant step | |
Vector | VInterpTo | Interpolate Vector from Current to Target | |
Vector | VInterpConstantTo | Interpolate Vector from Current to Target with a constant step |
Round
​
Rounds a number
— Returns number (the rounded number).
local ret = HELIXMath.Round(value)
Type | Parameter | Default | Description |
---|---|---|---|
number | value | The number to be rounded |
Clamp
​
Clamps a number
— Returns number (the number clamped).
local ret = HELIXMath.Clamp(value, min, max)
Type | Parameter | Default | Description |
---|---|---|---|
number | value | The number to be clamped | |
number | min | The min value | |
number | max | The max value |
ClampAxis
​
Clamps an angle to the range of [0, 360]
— Returns number (the number clamped).
local ret = HELIXMath.ClampAxis(value)
Type | Parameter | Default | Description |
---|---|---|---|
number | value | The number to be clamped |
NormalizeAxis
​
Clamps an angle to the range of [-180, 180]
— Returns number (the number clamped).
local ret = HELIXMath.NormalizeAxis(value)
Type | Parameter | Default | Description |
---|---|---|---|
number | value | The number to be clamped |
RelativeTo
​
Calculates the location and rotation relative to an actor
— Returns Vector, Rotator (the location relative to the actor, the rotation relative to the actor).
local ret_01, ret_02 = HELIXMath.RelativeTo(location, rotation, actor)
Type | Parameter | Default | Description |
---|---|---|---|
Vector | location | The location of the new system | |
Rotator | rotation | The rotation of the new system | |
Base Actor | actor | The actor to be translated to the new system |
FInterpTo
​
Interpolate number from Current to Target
— Returns number.
local ret = HELIXMath.FInterpTo(current, target, delta_time, interp_speed)
RInterpTo
​
Interpolate Rotator from Current to Target
— Returns Rotator.
local ret = HELIXMath.RInterpTo(current, target, delta_time, interp_speed)
RInterpConstantTo
​
Interpolate Rotator from Current to Target with a constant step
— Returns Rotator.
local ret = HELIXMath.RInterpConstantTo(current, target, delta_time, interp_speed)
VInterpTo
​
Interpolate Vector from Current to Target
— Returns Vector.
local ret = HELIXMath.VInterpTo(current, target, delta_time, interp_speed)
VInterpConstantTo
​
Interpolate Vector from Current to Target with a constant step
— Returns Vector.
local ret = HELIXMath.VInterpConstantTo(current, target, delta_time, interp_speed)