Skip to main content
Version: latest - a1.7.0 βš–οΈ

Quat

Floating point Quaternion that can represent a rotation about an axis in 3-D space

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!

info

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

Usage​

local new_quaternion = Quat(0.5, 0.5, 1, -1)
local rotation = new_quaterion:Rotator()

Properties​

TypeNameDescription
numberXThe quaternion's X-component
numberYThe quaternion's Y-component
numberZThe quaternion's Z-component
numberWThe quaternion's W-component

Functions​

ReturnsNameDescription
Normalize()In place normalize this Quaternion
RotatorRotator()Get the Rotator representation of this Quaternion.