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.
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.
Set the values of this object from the given array starting at the given offset.
The array to read the values from.
(optional) The offset to start reading from.
A reference to this instance.
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
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.
Resets the quaternion to the identity-quaternion and clears cache. Used by the recycler to reset.
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.
Returns a formatted string representation of this quaternion
Updates the values of the given mutator according to the current state of the instance
StaticANGLEReturn the angle in degrees between the two given quaternions.
StaticCONJUGATEComputes and returns the conjugate of a passed quaternion.
Optional quaternion to store the result in.
StaticDOTStaticgetStaticIDENTITYRetrieve a new identity quaternion
StaticINVERSEComputes and returns the inverse of a passed quaternion. Quaternion is assumed to be normalized.
Optional quaternion to store the result in.
StaticLERPPerforms 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.
Performs a linear interpolation between two quaternions. Result should be normalized afterwards to represent a valid rotation.
_out or a new quaternion if none is provided.
StaticnegateStaticNORMALIZATIONNormalize 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.
Normalize a quaternion making it a valid rotation representation.
_out or a new quaternion if none is provided.
StaticNORMALIZE_StaticPRODUCTComputes and returns the product of two passed quaternions.
Optional quaternion to store the result in.
StaticROTATIONReturns 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.
StaticROTATION_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.
StaticROTATION_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.
StaticROTATION_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.
StaticROTATION_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.
StaticSLERPPerforms 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.
Performs a spherical linear interpolation between two quaternions.
_out or a new quaternion if none is provided.
StaticSLERP_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
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