Rotator

A container for rotation information. All rotation values are stored in degrees.

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!

Tip

This structure supports +, -, * and tostring operations.

Usage

local NewRotator = Rotator(45, 90, 180)

Properties

Type

Name

Description

number

Pitch

number

Yaw

number

Roll

Functions

Returns

Name

Description

Vector

GetForwardVector()

Get the forward (X) unit direction vector from this component, in world space.

Vector

RotateVector()

Rotates a Vector by this Rotator.

Normalize()

In-place normalize, removes all winding and creates the “shortest route” rotation.

Rotator

GetNormalized()

Returns a new Rotator normalized.

boolean

IsNearlyZero(number Tolerance)

boolean

IsZero()