Quaternion class.
Static variables
Constructor
inlinenew(x:Float = 0, y:Float = 0, z:Float = 0, w:Float = 1)
Creates a new quaternion. The quaternion is identity by default.
Variables
Methods
inlinefromMat3(m:Mat3):Quat
Sets this quaternion to the representation of the matrix m
, and returns this
.
The matrix m
must be a rotation matrix, that is, must be orthogonalized and have determinant 1.
inlinenormalize():Quat
Sets this quaternion to the normalized quaternion and returns this
.
If the length is zero, this quaternion is set to zero quaternion.
inlinenormalized():Quat
Returns the normalized quaternion.
If the length is zero, zero quaterinon is returned.
setArc(v1:Vec3, v2:Vec3):Quat
Sets this quaternion to the quaternion representing the shortest arc
rotation from v1
to v2
, and return this
.