Optionalx: numberThe x component. Default 0.
Optionaly: numberThe y component. Default 0.
Optionalz: numberThe z component. Default 0.
Optionalw: numberThe w component. Default 1.
This callback is invoked, if set, each time a value in this quaternion is changed. The callback is passed one argument, a reference to this quaternion.
The w component of this Quaternion.
The x component of this Quaternion.
The y component of this Quaternion.
The z component of this Quaternion.
Add a given Quaternion or Vector to this Quaternion. Addition is component-wise.
The Quaternion or Vector to add to this Quaternion.
Create a unit (or rotation) Quaternion from its x, y, and z components.
Sets the w component.
Convert this Quaternion into its conjugate.
Sets the x, y and z components.
Copy the components of a given Quaternion or Vector into this Quaternion.
The Quaternion or Vector to copy the components from.
Calculate the dot product of this Quaternion and the given Quaternion or Vector.
The Quaternion or Vector to dot product with this Quaternion.
Convert the given Matrix into this Quaternion.
The Matrix to convert from.
Reset this Matrix to an identity (default) Quaternion.
Invert this Quaternion.
Calculate the length of this Quaternion.
Calculate the length of this Quaternion squared.
Linearly interpolate this Quaternion towards the given Quaternion or Vector.
The Quaternion or Vector to interpolate towards.
Optionalt: numberThe percentage of interpolation. Default 0.
Multiply this Quaternion by the given Quaternion or Vector.
The Quaternion or Vector to multiply this Quaternion by.
Normalize this Quaternion.
Rotate this Quaternion on the X axis.
The rotation angle in radians.
Rotate this Quaternion on the Y axis.
The rotation angle in radians.
Rotate this Quaternion on the Z axis.
The rotation angle in radians.
Rotates this Quaternion based on the two given vectors.
Scale this Quaternion by the given value.
The value to scale this Quaternion by.
Set the components of this Quaternion and optionally call the onChangeCallback.
Optionalx: number | objectThe x component, or an object containing x, y, z, and w components. Default 0.
Optionaly: numberThe y component. Default 0.
Optionalz: numberThe z component. Default 0.
Optionalw: numberThe w component. Default 0.
Optionalupdate: booleanCall the onChangeCallback? Default true.
Set the axis angle of this Quaternion.
Set this Quaternion from the given Euler, based on Euler order.
The Euler to convert from.
Optionalupdate: booleanRun the onChangeCallback? Default true.
Sets the rotation of this Quaternion from the given Matrix4.
Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector.
The Quaternion or Vector to interpolate towards.
The percentage of interpolation.
Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise.
The Quaternion or Vector to subtract from this Quaternion.
A quaternion.