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β
Type | Name | Description |
---|---|---|
number | X | The quaternion's X-component |
number | Y | The quaternion's Y-component |
number | Z | The quaternion's Z-component |
number | W | The quaternion's W-component |
Functionsβ
Returns | Name | Description |
---|---|---|
Normalize() | In place normalize this Quaternion | |
Rotator | Rotator() | Get the Rotator representation of this Quaternion. |