Internal Float32Array storage for quaternion components
ReadonlyclassThe class name identifier
The w component (real quaternion basis) - mutable
The x component (i quaternion basis) - mutable
The y component (j quaternion basis) - mutable
The z component (k quaternion basis) - mutable
Adds another quaternion to this one in place.
The quaternion to add
This quaternion for method chaining
Gets the component value at the specified index.
Index (0=x, 1=y, 2=z, 3=w)
The component value at the given index
Sets this quaternion to represent a rotation around an axis by a given angle.
The axis of rotation (should be normalized)
The angle of rotation in radians
This quaternion for method chaining
Creates a mutable copy of this quaternion.
A new mutable quaternion with the same values
Creates a mutable copy of this quaternion.
A new mutable quaternion with the same values
Copies the components from another quaternion into this one.
The source quaternion to copy from
This quaternion for method chaining
Divides this quaternion by a scalar value in place.
The scalar value to divide by
This quaternion for method chaining
Calculates the dot product between this quaternion and another.
The other quaternion
The dot product result
Converts the quaternion to a flat array of numbers.
Array containing [x, y, z, w] components
Sets this quaternion from a rotation matrix.
The source rotation matrix
This quaternion for method chaining
Sets this quaternion to the identity quaternion (0, 0, 0, 1).
This quaternion for method chaining
Checks if this quaternion is a dummy/invalid quaternion.
True if the quaternion is dummy, false otherwise
Compares this quaternion with another quaternion for equality within a tolerance.
The quaternion to compare with
Optionaldelta: numberOptional tolerance value for comparison (default uses system epsilon)
True if quaternions are equal within tolerance, false otherwise
Compares this quaternion with another quaternion for strict equality.
The quaternion to compare with
True if quaternions are exactly equal, false otherwise
Calculates the magnitude (length) of the quaternion.
The magnitude of the quaternion
Calculates the squared magnitude of the quaternion. More efficient than length() when only comparison is needed.
The squared magnitude of the quaternion
Multiplies this quaternion by another quaternion in place (quaternion composition).
The quaternion to multiply with
This quaternion for method chaining
Multiplies this quaternion by a scalar value in place.
The scalar value to multiply by
This quaternion for method chaining
Normalizes this quaternion to unit length in place.
This quaternion for method chaining
Gets the raw typed array backing this quaternion.
The underlying TypedArray storage
Sets the component value at the specified index.
Index (0=x, 1=y, 2=z, 3=w)
The value to set
This quaternion for method chaining
Sets all four components of the quaternion.
The x component value
The y component value
The z component value
The w component value
This quaternion for method chaining
Subtracts another quaternion from this one in place.
The quaternion to subtract
This quaternion for method chaining
Converts the quaternion to Euler angles.
A new vector containing Euler angles (x=pitch, y=yaw, z=roll)
Converts the quaternion to Euler angles and stores the result in the provided vector.
The output vector to store the Euler angles
The output vector containing Euler angles (x=pitch, y=yaw, z=roll)
Returns a string representation of the quaternion.
String representation of the quaternion
Returns an approximate string representation of the quaternion with limited precision.
Approximate string representation
Transforms a 3D vector by this quaternion rotation and stores the result in the output vector.
The vector to transform
The output vector to store the result
The output vector containing the transformed result
Mutable quaternion interface that extends IQuaternion with modification capabilities. Provides methods to modify quaternion components and perform in-place operations.