Creates a new AnimatedQuaternion instance.
Map of animation samplers keyed by track names
The initial active animation track name
Protected_Internal typed array storage for quaternion components [x, y, z, w].
Whether the animation should loop when it reaches the end.
Protected Static Readonly_The typed array constructor used for newly created quaternions.
Gets the current blending ratio between animation tracks.
The current blending ratio
Sets the blending ratio between the first and second active animation tracks.
Blending ratio (0.0 = first track only, 1.0 = second track only)
Gets the class name for debugging and reflection purposes.
The string "Quaternion"
Gets the w component of the quaternion. Triggers an update before returning the value.
The w component
Gets the x component of the quaternion. Triggers an update before returning the value.
The x component
Gets the y component of the quaternion. Triggers an update before returning the value.
The y component
Gets the z component of the quaternion. Triggers an update before returning the value.
The z component
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
Deletes an animation sampler for the specified track.
The animation track name to delete
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
Gets all available animation track names.
Array of all animation track names
Gets the animation sampler for the specified track.
The animation track name
The animation sampler for the track
Number of actual interpolations performed. Intended for tests and benchmarks.
Gets the track name of the sampler that is actually bound as the first animation. This can differ from the requested active track when that track has no sampler.
The track name of the currently evaluated first sampler
Gets the name of the first active animation track.
The first active animation track name
Returns the quaternion values as a number array.
Array containing the x, y, z, w components of the quaternion
Gets the track name of the sampler that is actually bound as the second animation. This can differ from the requested active track when that track has no sampler.
The track name of the currently evaluated second sampler, or undefined if none is bound
Gets the name of the second active animation track.
The second active animation track name, or undefined if not set
Gets the internal value array without allocating a copy. Do not mutate the returned array.
Drops the memoized interpolation result. Call this after mutating sampler data directly.
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
Sets or updates an animation sampler for the specified track.
The animation track name
The animation sampler to set
Sets the first active animation track.
The name of the animation track to set as the first active track
Sets the quaternion values from a Float32Array.
Float32Array containing the quaternion components [x, y, z, w]
Sets the second active animation track for blending.
The name of the animation track to set as the second active track
Sets the local animation time for this quaternion. When set, this time will be used instead of the global animation time.
The animation time in seconds
Sets the time and blending ratio and evaluates the value at most once.
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
Updates the quaternion values based on the current animation time and active tracks. This method interpolates values from animation samplers and handles blending between tracks. If looping is enabled, the time will wrap around the animation duration.
Switches to using global animation time instead of local time. Resets the local time and triggers an update.
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
An animated quaternion that can be driven by animation samplers. This class extends the base Quaternion class to provide animation capabilities, allowing quaternion values to be interpolated over time using animation tracks. Supports blending between multiple animation tracks and both local and global time management.