LuaSTG-x Core API
math::quaternion Class Reference

Public Member Functions

function __eq (local other)
 
function __mul (local other)
 
function __tostring ()
 
function clone ()
 
function conjugate ()
 
function createFromAxisAngle (local axis, local angle)
 
function createFromRotationMatrix (local mat)
 
function fuzzyEquals (local other, local var)
 
function getConjugated ()
 
function getInversed ()
 
function getNormalized ()
 
static function identity ()
 
function inverse ()
 
function isIdentity ()
 
function isZero ()
 
function lerp (local other, local t)
 
function multiply (local other)
 
function normalize ()
 
function set (local ...)
 
function setIdentity ()
 
function slerp (local other, local t)
 
static function squad (local q1, local q2, local s1, local s2, local t)
 
function toAxisAngle ()
 
static function zero ()
 

Public Attributes

number w
 
number x
 
number y
 
number z
 

Member Function Documentation

◆ __eq()

function __eq ( local  other)

◆ __mul()

function __mul ( local  other)

◆ __tostring()

function __tostring ( )

◆ clone()

function clone ( )

◆ conjugate()

function conjugate ( )

◆ createFromAxisAngle()

function createFromAxisAngle ( local  axis,
local  angle 
)

◆ createFromRotationMatrix()

function createFromRotationMatrix ( local  mat)

◆ fuzzyEquals()

function fuzzyEquals ( local  other,
local  var 
)

◆ getConjugated()

function getConjugated ( )

◆ getInversed()

function getInversed ( )

◆ getNormalized()

function getNormalized ( )

◆ identity()

static function identity ( )

◆ inverse()

function inverse ( )

◆ isIdentity()

function isIdentity ( )

◆ isZero()

function isZero ( )

◆ lerp()

function lerp ( local  other,
local  t 
)

Interpolates between two quaternions using linear interpolation.

The interpolation curve for linear interpolation between

quaternions gives a straight line in quaternion space.

◆ multiply()

function multiply ( local  other)

◆ normalize()

function normalize ( )

◆ set()

function set ( local ...  )

◆ setIdentity()

function setIdentity ( )

◆ slerp()

function slerp ( local  other,
local  t 
)

Interpolates between two quaternions using spherical linear interpolation.

Spherical linear interpolation provides smooth transitions between different

orientations and is often useful for animating models or cameras in 3D.

Note: For accurate interpolation, the input quaternions must be at (or close to) unit length.

This method does not automatically normalize the input quaternions, so it is up to the

caller to ensure they call normalize beforehand, if necessary.

◆ squad()

static function squad ( local  q1,
local  q2,
local  s1,
local  s2,
local  t 
)

Interpolates over a series of quaternions using spherical spline interpolation.

Spherical spline interpolation provides smooth transitions between different

orientations and is often useful for animating models or cameras in 3D.

Note: For accurate interpolation, the input quaternions must be unit.

This method does not automatically normalize the input quaternions,

so it is up to the caller to ensure they call normalize beforehand, if necessary.

◆ toAxisAngle()

function toAxisAngle ( )

Converts this Quaternion4f to axis-angle notation. The axis is normalized.

Returns
math.vec3, number

◆ zero()

static function zero ( )

Member Data Documentation

◆ w

number w

◆ x

number x

◆ y

number y

◆ z

number z

The documentation for this class was generated from the following file: