Skip to main content

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​

ReturnsNameDescription
numberRoundRounds a number
numberClampClamps a number
numberClampAxisClamps an angle to the range of [0, 360]
numberNormalizeAxisClamps an angle to the range of [-180, 180]
Vector, RotatorRelativeToCalculates the location and rotation relative to an actor
numberFInterpToInterpolate number from Current to Target
RotatorRInterpToInterpolate Rotator from Current to Target
RotatorRInterpConstantToInterpolate Rotator from Current to Target with a constant step
VectorVInterpToInterpolate Vector from Current to Target
VectorVInterpConstantToInterpolate Vector from Current to Target with a constant step

Round​

Rounds a number

— Returns number (the rounded number).

local ret = HELIXMath.Round(value)
TypeParameterDefaultDescription
numbervalueThe number to be rounded

Clamp​

Clamps a number

— Returns number (the number clamped).

local ret = HELIXMath.Clamp(value, min, max)
TypeParameterDefaultDescription
numbervalueThe number to be clamped
numberminThe min value
numbermaxThe max value

ClampAxis​

Clamps an angle to the range of [0, 360]

— Returns number (the number clamped).

local ret = HELIXMath.ClampAxis(value)
TypeParameterDefaultDescription
numbervalueThe number to be clamped

NormalizeAxis​

Clamps an angle to the range of [-180, 180]

— Returns number (the number clamped).

local ret = HELIXMath.NormalizeAxis(value)
TypeParameterDefaultDescription
numbervalueThe 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)
TypeParameterDefaultDescription
VectorlocationThe location of the new system
RotatorrotationThe rotation of the new system
Base ActoractorThe 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)
TypeParameterDefaultDescription
numbercurrent
numbertarget
numberdelta_time
numberinterp_speed

RInterpTo​

Interpolate Rotator from Current to Target

— Returns Rotator.

local ret = HELIXMath.RInterpTo(current, target, delta_time, interp_speed)
TypeParameterDefaultDescription
Rotatorcurrent
Rotatortarget
numberdelta_time
numberinterp_speed

RInterpConstantTo​

Interpolate Rotator from Current to Target with a constant step

— Returns Rotator.

local ret = HELIXMath.RInterpConstantTo(current, target, delta_time, interp_speed)
TypeParameterDefaultDescription
Rotatorcurrent
Rotatortarget
numberdelta_time
numberinterp_speed

VInterpTo​

Interpolate Vector from Current to Target

— Returns Vector.

local ret = HELIXMath.VInterpTo(current, target, delta_time, interp_speed)
TypeParameterDefaultDescription
Vectorcurrent
Vectortarget
numberdelta_time
numberinterp_speed

VInterpConstantTo​

Interpolate Vector from Current to Target with a constant step

— Returns Vector.

local ret = HELIXMath.VInterpConstantTo(current, target, delta_time, interp_speed)
TypeParameterDefaultDescription
Vectorcurrent
Vectortarget
numberdelta_time
numberinterp_speed