Class: Quaternion
Functions
| Name | Description |
|---|---|
.new() | |
.new(w,x,y,z) | |
.newAngleAxis(angle,axis) | |
.newIdentity() | |
.newRandom() |
Methods
| Name | Description |
|---|---|
:__add(other) | |
:__div(other) | |
:__eq(other) | |
:__le(other) | |
:__lt(other) | |
:__mul(other) | |
:__sub(other) | |
:__unm() | |
:angle() | |
:axis() | |
:conjugate() | |
:dot(other) | |
:eulerAngles() | Returns euler angles, pitch as x, yaw as y, roll as z. |
:inverse() | |
:isinf() | Returns true if x holds a positive infinity or negative infinity |
:isnan() | Returns true if x holds a NaN (not a number) |
:length() | |
:lerp(other,a) | |
:mat3Cast() | |
:mat4Cast() | |
:normalized() | |
:pitch() | |
:roll() | |
:rotate(angle,axis) | Returns a new rotated quaternion |
:slerp(other,a) | |
:yaw() |
Fields
| Name | Type | Description |
|---|---|---|
w | number | |
x | number | |
y | number | |
z | number |
Function declarations
Function: new
lua
function Quaternion.new() endReturns:
Function: new
lua
function Quaternion.new(
w,
x,
y,
z
) endParameters:
- w (
number) - x (
number) - y (
number) - z (
number)
Returns:
Function: newAngleAxis
lua
function Quaternion.newAngleAxis(
angle,
axis
) endParameters:
- angle (
number) - Angle in radians - axis (Vector3f)
Returns:
Function: newIdentity
lua
function Quaternion.newIdentity() endReturns:
Function: newRandom
lua
function Quaternion.newRandom() endReturns:
Method declarations
Method: __add
lua
function Quaternion:__add(
other
) endParameters:
- other (Quaternion)
Returns:
Method: __div
lua
function Quaternion:__div(
other
) endParameters:
- other (Quaternion)
Returns:
number|Quaternion
Method: __eq
lua
function Quaternion:__eq(
other
) endParameters:
- other (Quaternion)
Returns:
Method: __le
lua
function Quaternion:__le(
other
) endParameters:
- other (Quaternion)
Returns:
boolean
Method: __lt
lua
function Quaternion:__lt(
other
) endParameters:
- other (Quaternion)
Returns:
boolean
Method: __mul
lua
function Quaternion:__mul(
other
) endParameters:
- other (Quaternion)
Returns:
number|Quaternion
Method: __sub
lua
function Quaternion:__sub(
other
) endParameters:
- other (Quaternion)
Returns:
Method: __unm
lua
function Quaternion:__unm() endReturns:
Method: angle
lua
function Quaternion:angle() endReturns:
number
Method: axis
lua
function Quaternion:axis() endReturns:
Method: conjugate
lua
function Quaternion:conjugate() endReturns:
Method: dot
lua
function Quaternion:dot(
other
) endParameters:
- other (Quaternion)
Returns:
number
Method: eulerAngles
Returns euler angles, pitch as x, yaw as y, roll as z. The result is expressed in radians.
lua
function Quaternion:eulerAngles() endReturns:
Method: inverse
lua
function Quaternion:inverse() endReturns:
Method: isinf
Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations. Returns false otherwise, including for implementations with no infinity
lua
function Quaternion:isinf() endReturns:
Method: isnan
Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations. Returns false otherwise, including for implementations with no NaN representations.
lua
function Quaternion:isnan() endReturns:
Method: length
lua
function Quaternion:length() endReturns:
number
Method: lerp
lua
function Quaternion:lerp(
other,
a
) endParameters:
- other (Quaternion)
- a (
number) - Interpolation factor
Returns:
Method: mat3Cast
lua
function Quaternion:mat3Cast() endReturns:
Method: mat4Cast
lua
function Quaternion:mat4Cast() endReturns:
Method: normalized
lua
function Quaternion:normalized() endReturns:
Method: pitch
lua
function Quaternion:pitch() endReturns:
number
Method: roll
lua
function Quaternion:roll() endReturns:
number
Method: rotate
Returns a new rotated quaternion
lua
function Quaternion:rotate(
angle,
axis
) endParameters:
- angle (
number) - Angle in radians - axis (Vector3f) - Axis of rotation
Returns:
Method: slerp
lua
function Quaternion:slerp(
other,
a
) endParameters:
- other (Quaternion)
- a (
number) - Interpolation factor
Returns:
Method: yaw
lua
function Quaternion:yaw() endReturns:
number
Field declarations
Field: w
Type: number
Field: x
Type: number
Field: y
Type: number
Field: z
Type: number
