Abstract
Protected
_vInternal typed array storage for quaternion components [x, y, z, w].
Gets the class name of the quaternion implementation.
The name of the constructor function
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
Creates a deep copy of this quaternion.
A new quaternion instance with the same 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
Checks if this quaternion is approximately equal to another quaternion within a tolerance.
The quaternion to compare against
Optional
delta: numberOptional tolerance value for comparison
True if quaternions are approximately equal, false otherwise
Checks if this quaternion is exactly equal to another quaternion.
The quaternion to compare against
True if quaternions are exactly equal, false otherwise
Converts the quaternion to Euler angles and stores the result in the output vector.
The mutable vector to store the resulting Euler angles
The output vector containing the Euler angles
Transforms a 3D vector by this quaternion rotation and stores the result in the output vector.
The vector to transform
The mutable vector to store the result
The output vector containing the transformed result
Abstract base class for quaternion implementations.
Quaternions are a mathematical system that extends complex numbers and are commonly used in 3D graphics for representing rotations. A quaternion consists of four components (x, y, z, w) where (x, y, z) represents the vector part and w represents the scalar part.
This abstract class provides common functionality and interface for all quaternion implementations while leaving specific operations to be implemented by concrete subclasses.