BBMOD_Quaternion

constructor

new BBMOD_Quaternion([_x, _y, _z, _w])

Description

A quaternion.

Arguments

Name Type Description
_x Real The first component of the quaternion. Defaults to 0.
_y Real The second component of the quaternion. Defaults to 0.
_z Real The third component of the quaternion. Defaults to 0.
_w Real The fourth component of the quaternion. Defaults to 1.

Properties

Name Description
W The fourth component of the quaternion.
X The first component of the quaternion.
Y The second component of the quaternion.
Z The third component of the quaternion.

Methods

Name Description
Add Adds quaternions and returns the result as a new quaternion.
Clone Creates a clone of the quaternion.
Conjugate Conjugates the quaternion and returns the result as a quaternion.
Copy Copies components of the quaternion into other quaternion.
Dot Computes a dot product of two dual quaternions.
Exp Computes an exponential map of the quaternion and returns the result as a new quaternion.
FromArray Loads quaternion components (x, y, z, w) from an array.
FromAxisAngle Initializes the quaternion using an axis and an angle.
FromBuffer Loads quaternion components (x, y, z, w) from a buffer.
FromEuler Initializes the quaternion using euler angles.
FromLookRotation Initializes the quaternion using a forward and an up vector. These vectors must not be parallel! If they are, the quaternion will be set to an identity.
GetAngle Retrieves the rotation angle of the quaternion.
GetAxis Retrieves the axis of rotation of the quaternion.
Inverse Computes an inverse of the quaternion and returns the result as a new quaternion.
Length Computes the length of the quaternion.
LengthSqr Computes a squared length of the quaternion.
Lerp Computes a linear interpolation of two quaternions and returns the result as a new quaternion.
Log Computes the logarithm map of the quaternion and returns the result as a new quaternion.
Mul Multiplies two quaternions and returns the result as a new quaternion.
Normalize Normalizes the quaternion and returns the result as a new quaternion.
Rotate Rotates a vector using the quaternion and returns the result as a new vector.
Scale Scales each component of the quaternion by a real value and returns the result as a new quaternion.
Slerp Computes a spherical linear interpolation of two quaternions and returns the result as a new quaternion.
ToArray Writes components (x, y, z, w) of the quaternion into an array.
ToMatrix Converts quaternion into a matrix.

Note

If you leave the arguments to their default values, then an identity quaternion is created.

Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on November 16, 2022 using GMDoc.