Creates a new Quaternion instance.
The typed array containing the quaternion components
Protected_Internal typed array storage for quaternion components [x, y, z, w].
Protected Static Readonly_The typed array constructor used for newly created quaternions.
Gets the class name for debugging and reflection purposes.
The string "Quaternion"
Gets the w component (scalar part) of the quaternion.
The w component value
Gets the x component (i coefficient) of the quaternion.
The x component value
Gets the y component (j coefficient) of the quaternion.
The y component value
Gets the z component (k coefficient) of the quaternion.
The z component value
StaticcompositionGets the composition type for this quaternion class.
CompositionType.Vec4 indicating this is a 4-component vector
Gets the component at the specified index.
The index (0=x, 1=y, 2=z, 3=w)
The component value at the given index
Creates a deep copy of this quaternion.
A new quaternion with the same component values
Calculates the dot product between this quaternion and another quaternion. The dot product of two quaternions gives a scalar value that represents the cosine of half the angle between them when both quaternions are unit quaternions.
The quaternion to compute the dot product with
The dot product result
Converts the quaternion to a flat array representation.
An array containing [x, y, z, w] components
Checks if this quaternion is a dummy (uninitialized) quaternion.
True if the internal array has zero length, false otherwise
Checks if this quaternion is approximately equal to another quaternion within a tolerance.
The quaternion to compare with
The tolerance value (default: Number.EPSILON)
True if all components are within the tolerance, false otherwise
Checks if this quaternion is exactly equal to another quaternion.
The quaternion to compare with
True if all components are exactly equal, false otherwise
Calculates the magnitude (length) of the quaternion.
The Euclidean norm of the quaternion
Calculates the squared magnitude of the quaternion. This is more efficient than length() when you only need to compare magnitudes.
The squared Euclidean norm of the quaternion
Converts the quaternion to Euler angles. The rotation order is XYZ (roll, pitch, yaw).
A new Vector3 containing the Euler angles in radians
Converts the quaternion to Euler angles and stores the result in the output vector. The rotation order is XYZ (roll, pitch, yaw).
The output vector to store the Euler angles [x, y, z]
The output vector containing the Euler angles in radians
Converts the quaternion to a string representation.
A string in the format "(x, y, z, w)"
Converts the quaternion to an approximately formatted string using financial precision.
A formatted string with components separated by spaces and ending with newline
Transforms a 3D vector by the inverse of this quaternion rotation.
The vector to transform
A new transformed vector
Transforms a 3D vector by this quaternion rotation and stores the result in the output parameter.
The vector to transform
The output vector to store the result
The output vector containing the transformed result
StaticaddStaticaddaddTo
StaticaxisStaticclampStaticdivideStaticdividedivideNumberTo
Staticdummydummy
StaticfromStaticfromfromAxisAngleTo
StaticfromStaticfromStaticfromStaticfromStaticfromStaticfromStaticfromCreates a quaternion that directly uses the given Float32Array (no copy).
StaticfromStaticfromStaticfromStaticfromStaticfromfromToRotationTo
StaticfromCreates a quaternion that directly uses the given typed array (no copy).
The typed array containing quaternion components
A new quaternion using the provided array
StaticgetStaticidentityidentity
StaticinvertStaticinvertStaticlerpStaticlerplerpTo
StaticlookStaticlookStaticlookStaticmultiplyStaticmultiplyStaticmultiplymultiplyNumberTo
StaticmultiplymultiplyTo
StaticnormalizeStaticnormalizeStaticqlerpStaticqlerpqlerpTo
StaticsubtractStaticsubtractsubtractTo
StatictryStatictryStatictryStatictryStatictry
Immutable quaternion with 32-bit float components.