Constructor

@:value({ w : 1.0, z : 0.0, y : 0.0, x : 0.0 })inlinenew(x:FastFloat = 0.0, y:FastFloat = 0.0, z:FastFloat = 0.0, w:FastFloat = 1.0)

Variables

Methods

inlineadd(q:Quat):Quat

inlineaddquat(a:Quat, b:Quat):Quat

inlinedot(q:Quat):FastFloat

Find the dot product of this quaternion with another.

Parameters:

q

The other quaternion.

Returns:

The dot product.

inlinefromAxisAngle(axis:Vec4, angle:FastFloat):Quat

inlinefromEuler(x:FastFloat, y:FastFloat, z:FastFloat):Quat

Set this quaternion to the rotation represented by a YZX Euler (XZY in blender terms).

Parameters:

x

The Euler's x component.

y

The Euler's y component.

z

The Euler's z component.

Returns:

This quaternion.

inlinefromEulerOrdered(e:Vec4, order:String):Quat

Set this quaternion to the rotation represented by an Euler.

Parameters:

x

The Euler's x component.

y

The Euler's y component.

z

The Euler's z component.

order:

the (blender) order of the euler (which is the OPPOSITE of the mathematical order) can be "XYZ", "XZY", "YXZ", "YZX", "ZXY", or "ZYX".

Returns:

This quaternion.

inlinefromMat(m:Mat4):Quat

inlinefromTo(v1:Vec4, v2:Vec4):Quat

inlinegetEuler():Vec4

Convert this quaternion to a YZX Euler (note: XZY in blender order terms).

Returns:

A new YZX Euler that represents the same rotation as this quaternion.

inlineinverse(q:Quat):Quat

Invert the given quaternion and store the result in this one.

Parameters:

q

Quaternion to invert.

Returns:

This quaternion.

inlinelerp(from:Quat, to:Quat, s:FastFloat):Quat

Linearly interpolate between two other quaterions, and store the result in this one. This is not a so-called slerp operation.

Parameters:

from

The quaterion to interpolate from.

to

The quaterion to interpolate to.

s

The amount to interpolate, with 0 being from and 1 being to, and 0.5 being half way between the two.

Returns:

This quaternion.

inlinemult(q:Quat):Quat

Multiply this quaternion by another.

Parameters:

q

The quaternion to multiply this one with.

Returns:

This quaternion.

inlinemultquats(q1:Quat, q2:Quat):Quat

Multiply two other quaternions and store the result in this one.

Parameters:

q1

The first operand.

q2

The second operand.

Returns:

This quaternion.

inlinenormalize():Quat

Scale this quaternion to have a magnitude of 1.

Returns:

This quaternion.

inlinescale(scale:FastFloat):Quat

inlinescalequat(q:Quat, scale:FastFloat):Quat

inlinesetFrom(q:Quat):Quat

Copy the rotation of another quaternion to this one.

Parameters:

q

A quaternion to copy.

Returns:

This quaternion.

inlineslerp(from:Quat, to:Quat, t:FastFloat):Quat

inlinesub(q:Quat):Quat

inlinesubquat(a:Quat, b:Quat):Quat

inlinetoEulerOrdered(p:String):Vec4

Convert this quaternion to an Euler of arbitrary order.

Parameters:

the

order of the euler to obtain (in blender order, opposite from mathematical order) can be "XYZ", "XZY", "YXZ", "YZX", "ZXY", or "ZYX".

Returns:

A new YZX Euler that represents the same rotation as this quaternion.