Creates and returns a clone of this quaternion.
Retrieves the type of this mutable subclass as the name of the runtime class
The type of the mutable
See EventTarget.addEventListener for reference. Works with EventListenerUnified and EventUnified
Optional
_options: boolean | AddEventListenerOptionsUpdates the property values of the instance according to the state of the animation mutator. Override to implement custom animation behavior.
Conjugates this quaternion and returns it.
A reference to this quaternion.
Copies the given quaternion.
A reference to this quaternion.
Recreates this instance of Serializable with the information from the given Serialization.
See EventTarget.dispatchEvent for reference. Works with with EventUnified
Returns true if this quaternion is equal to the given quaternion within the given tolerance.
Retrieves the specified attribute types from the metadata of this instance's class.
Collect applicable attributes of the instance and copies of their values in a Mutator-object. By default, a mutator cannot be extended, since extensions are not available in the object the mutator belongs to. A mutator may be reduced by the descendants of Mutable to contain only the properties needed.
Returns an associative array with the same attributes as the given mutator, but with the corresponding types as string-values. Does not recurse into objects! This will return the decorated meta-type instead of the runtime-type of the object, if available.
Collect the attributes of the instance and their values applicable for animation. Basic functionality is identical to getMutator, returned mutator should then be reduced by the subclassed instance
Collect the attributes of the instance and their values applicable for the user interface. Basic functionality is identical to getMutator, returned mutator should then be reduced by the subclassed instance
Invert this quaternion. Quaternion is assumed to be normalized.
A reference to this quaternion.
Multiply this quaternion with the given quaternion.
A reference to this quaternion.
Updates the attribute values of the instance according to the state of the mutator. The mutation may be restricted to a subset of the mutator and the event dispatching suppressed. Uses mutateBase, but can be overwritten in subclasses
Negates this quaternion.
A reference to this quaternion.
Normalizes this quaternion to a length of 1 (a unit quaternion) making it a valid rotation representation.
A reference to this quaternion.
Premultiply this quaternion with the given quaternion.
A reference to this quaternion.
See EventTarget.removeEventListener for reference. Works with EventListenerUnified and EventUnified
Optional
_options: boolean | AddEventListenerOptionsReturns a Serialization of this object.
Sets the components of this quaternion.
A reference to this quaternion.
Copy the values of this object into the given array starting at the given offset. Creates a new array if none is provided.
(optional) The receiving array.
(optional) The offset to start writing to.
_out
or a new array if none is provided.
Updates the values of the given mutator according to the current state of the instance
Static
ANGLEReturn the angle in degrees between the two given quaternions.
Static
CONJUGATEComputes and returns the conjugate of a passed quaternion.
Optional quaternion to store the result in.
Static
DOTReturns the dot product of two quaternions.
Static
IDENTITYRetrieve a new identity quaternion
Static
INVERSEComputes and returns the inverse of a passed quaternion. Quaternion is assumed to be normalized.
Optional quaternion to store the result in.
Static
LERPPerforms a linear interpolation between two quaternions. Result should be normalized afterwards to represent a valid rotation.
the first operand.
the second operand.
interpolation amount, in the range [0-1], between the two inputs.
Optional
_out: Quaternion(optional) the receiving quaternion.
_out
or a new quaternion if none is provided.
Static
NORMALIZATIONNormalize a quaternion making it a valid rotation representation.
quaternion to normalize
Optional
_out: Quaternion(optional) the receiving quaternion.
_out
or a new quaternion if none is provided.
Static
NORMALIZE_Static
PRODUCTComputes and returns the product of two passed quaternions.
Optional quaternion to store the result in.
Static
ROTATIONReturns a quaternion that rotates coordinates when multiplied by, using the angles given. Rotation occurs around the axis in the order Z-Y-X.
Use ROTATION_EULER_ANGLES instead.
Returns a quaternion that rotates coordinates when multiplied by, using the axis and angle given. Axis must be normalized. Angle is in degrees.
Use ROTATION_AXIS_ANGLE instead.
Returns a quaternion that rotates coordinates when multiplied by, using the forward and up direction given.
Use ROTATION_LOOK_IN instead.
Static
ROTATION_Returns a quaternion that rotates coordinates when multiplied by, using the axis and angle given. Axis must be normalized. Angle is in degrees.
Optional quaternion to store the result in.
Static
ROTATION_Returns a quaternion that rotates coordinates when multiplied by, using the angles given. Rotation occurs around the axis in the order Z-Y-X.
Optional quaternion to store the result in.
Static
ROTATION_Returns a quaternion that will rotate one vector to align with another.
The normalized direction vector to rotate from.
The normalized direction vector to rotate to.
Optional quaternion to store the result in.
Static
ROTATION_Returns a quaternion with the given forward and up direction.
A unit vector indicating the desired forward-direction.
A unit vector indicating the up-direction.
Optional quaternion to store the result in.
Static
SLERPPerforms a spherical linear interpolation between two quaternions.
the first operand.
the second operand.
interpolation amount, in the range [0-1], between the two inputs.
Optional
_out: Quaternion(optional) the receiving quaternion.
_out
or a new quaternion if none is provided.
Static
SLERP_Performs a spherical linear interpolation between two quaternion arrays.
the first operand.
the offset into the first operand.
the second operand.
the offset into the second operand.
interpolation amount, in the range [0-1], between the two inputs.
the receiving quaternion array.
the offset into the receiving quaternion array.
out
Static
getStatic
negateNegates the given quaternion.
Storing and manipulating rotations in the form of quaternions. Constructed out of the 4 components: (x, y, z, w). Mathematical notation: w + xi + yj + zk. A Quaternion can be described with an axis and angle: (x, y, z) = sin(angle/2)*axis; w = cos(angle/2). roll: x, pitch: y, yaw: z. Note that operations are adapted to work with vectors where y is up and z is forward.
Authors
Matthias Roming, HFU, 2023 | Marko Fehrenbach, HFU, 2020 | Jonas Plotzky, HFU, 2023