NanosMathLibrary

A table containing useful and aux Math functions.

Tip

This structure is Open Sourced at https://github.com/nanos-world/nanos-world-lua-lib. Feel free to push merge requests and suggest changes!

Usage

local Axis = NanosMathLibrary.ClampAxis(720)

Functions

Returns

Name

Description

number

ClampAxis(number)

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

number

NormalizeAxis(number)

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

number

FInterpTo(number Current, number Target, number DeltaTime, number InterpSpeed)

Rotator

RInterpTo(Rotator Current, Rotator Target, number DeltaTime, number InterpSpeed)

Rotator

RInterpConstantTo(Rotator Current, Rotator Target, number DeltaTime, number InterpSpeed)

Vector

VInterpTo(Vector Current, Vector Target, number DeltaTime, number InterpSpeed)

Vector

VInterpConstantTo(Vector Current, Vector Target, number DeltaTime, number InterpSpeed)