Dual Quaternion
Format: [real, dual]
Quaternion format: XYZW
Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
Format: [real, dual]
Quaternion format: XYZW
Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
Members
-
Gets the real part of a dual quat
Methods
-
inneradd$7(out, a, b) → quat2
-
Adds two dual quat's
Name Type Description outquat2 the receiving dual quaternion aquat2 the first operand bquat2 the second operand Returns:
out -
innerclone$7(a) → quat2
-
Creates a new quat initialized with values from an existing quaternion
Name Type Description aquat2 dual quaternion to clone Returns:
new dual quaternion -
innerconjugate$1(out, a) → quat2
-
Calculates the conjugate of a dual quat If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.
Name Type Description outquat2 the receiving quaternion aquat2 quat to calculate conjugate of Returns:
out -
innercopy$7(out, a) → quat2
-
Copy the values from one dual quat to another
Name Type Description outquat2 the receiving dual quaternion aquat2 the source dual quaternion Returns:
out -
innercreate$7() → quat2
-
Creates a new identity dual quat
Returns:
a new dual quaternion [real -> rotation, dual -> translation] -
Calculates the dot product of two dual quat's (The dot product of the real parts)
Name Type Description aquat2 the first operand bquat2 the second operand Returns:
dot product of a and b -
Returns whether or not the dual quaternions have approximately the same elements in the same position.
Name Type Description aquat2 the first dual quat. bquat2 the second dual quat. Returns:
true if the dual quats are equal, false otherwise. -
Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)
Name Type Description aquat2 the first dual quaternion. bquat2 the second dual quaternion. Returns:
true if the dual quaternions are equal, false otherwise. -
innerfromMat4$1(out, a) → quat2
-
Creates a new dual quat from a matrix (4x4)
Name Type Description outquat2 the dual quaternion amat4 the matrix Returns:
dual quat receiving operation result -
innerfromRotation$4(dual, q) → quat2
-
Creates a dual quat from a quaternion
Name Type Description dualquat2 quaternion receiving operation result qquat the quaternion Returns:
dual quaternion receiving operation result -
innerfromRotationTranslation$1(dual, q, t) → quat2
-
Creates a dual quat from a quaternion and a translation
Name Type Description dualquat2 quaternion receiving operation result qquat a normalized quaternion tvec3 tranlation vector Returns:
dual quaternion receiving operation result -
innerfromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) → quat2
-
Creates a new dual quat from the given values (quat and translation)
Name Type Description x1Number X component y1Number Y component z1Number Z component w1Number W component x2Number X component (translation) y2Number Y component (translation) z2Number Z component (translation) Returns:
new dual quaternion -
innerfromTranslation$3(dual, t) → quat2
-
Creates a dual quat from a translation
Name Type Description dualquat2 quaternion receiving operation result tvec3 translation vector Returns:
dual quaternion receiving operation result -
innerfromValues$7(x1, y1, z1, w1, x2, y2, z2, w2) → quat2
-
Creates a new dual quat initialized with the given values
Name Type Description x1Number X component y1Number Y component z1Number Z component w1Number W component x2Number X component y2Number Y component z2Number Z component w2Number W component Returns:
new dual quaternion -
innergetDual(out, a) → quat
-
Gets the dual part of a dual quat
Name Type Description outquat dual part aquat2 Dual Quaternion Returns:
dual part -
innergetTranslation$1(out, a) → vec3
-
Gets the translation of a normalized dual quat
Name Type Description outvec3 translation aquat2 Dual Quaternion to be decomposed Returns:
translation -
inneridentity$5(out) → quat2
-
Set a dual quat to the identity dual quaternion
Name Type Description outquat2 the receiving quaternion Returns:
out -
innerinvert$5(out, a) → quat2
-
Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper
Name Type Description outquat2 the receiving dual quaternion aquat2 dual quat to calculate inverse of Returns:
out -
Alias for
quat2.length -
Calculates the length of a dual quat
Name Type Description aquat2 dual quat to calculate length of Returns:
length of a -
innerlerp$3(out, a, b, t) → quat2
-
Performs a linear interpolation between two dual quats's NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)
Name Type Description outquat2 the receiving dual quat aquat2 the first operand bquat2 the second operand tNumber interpolation amount, in the range [0-1], between the two inputs Returns:
out -
Alias for
quat2.multiply -
innermultiply$7(out, a, b) → quat2
-
Multiplies two dual quat's
Name Type Description outquat2 the receiving dual quaternion aquat2 the first operand bquat2 the second operand Returns:
out -
innernormalize$3(out, a) → quat2
-
Normalize a dual quat
Name Type Description outquat2 the receiving dual quaternion aquat2 dual quaternion to normalize Returns:
out -
innerrotateAroundAxis(out, a, axis, rad) → quat2
-
Rotates a dual quat around a given axis. Does the normalisation automatically
Name Type Description outquat2 the receiving dual quaternion aquat2 the dual quaternion to rotate axisvec3 the axis to rotate around radNumber how far the rotation should be Returns:
out -
innerrotateByQuatAppend(out, a, q) → quat2
-
Rotates a dual quat by a given quaternion (a * q)
Name Type Description outquat2 the receiving dual quaternion aquat2 the dual quaternion to rotate qquat quaternion to rotate by Returns:
out -
innerrotateByQuatPrepend(out, q, a) → quat2
-
Rotates a dual quat by a given quaternion (q * a)
Name Type Description outquat2 the receiving dual quaternion qquat quaternion to rotate by aquat2 the dual quaternion to rotate Returns:
out -
innerrotateX$3(out, a, rad) → quat2
-
Rotates a dual quat around the X axis
Name Type Description outquat2 the receiving dual quaternion aquat2 the dual quaternion to rotate radnumber how far should the rotation be Returns:
out -
innerrotateY$3(out, a, rad) → quat2
-
Rotates a dual quat around the Y axis
Name Type Description outquat2 the receiving dual quaternion aquat2 the dual quaternion to rotate radnumber how far should the rotation be Returns:
out -
innerrotateZ$3(out, a, rad) → quat2
-
Rotates a dual quat around the Z axis
Name Type Description outquat2 the receiving dual quaternion aquat2 the dual quaternion to rotate radnumber how far should the rotation be Returns:
out -
innerscale$7(out, a, b) → quat2
-
Scales a dual quat by a scalar number
Name Type Description outquat2 the receiving dual quat aquat2 the dual quat to scale bNumber amount to scale the dual quat by Returns:
out -
innerset$7(out, x1, y1, z1, w1, x2, y2, z2, w2) → quat2
-
Set the components of a dual quat to the given values
Name Type Description outquat2 the receiving quaternion x1Number X component y1Number Y component z1Number Z component w1Number W component x2Number X component y2Number Y component z2Number Z component w2Number W component Returns:
out -
innersetDual(out, q) → quat2
-
Set the dual component of a dual quat to the given quaternion
Name Type Description outquat2 the receiving quaternion qquat a quaternion representing the dual part Returns:
out -
innersetReal(out, q) → quat2
-
Set the real component of a dual quat to the given quaternion
Name Type Description outquat2 the receiving quaternion qquat a quaternion representing the real part Returns:
out -
Alias for
quat2.squaredLength -
Calculates the squared length of a dual quat
Name Type Description aquat2 dual quat to calculate squared length of Returns:
squared length of a -
Returns a string representation of a dual quatenion
Name Type Description aquat2 dual quaternion to represent as a string Returns:
string representation of the dual quat -
innertranslate$3(out, a, v) → quat2
-
Translates a dual quat by the given vector
Name Type Description outquat2 the receiving dual quaternion aquat2 the dual quaternion to translate vvec3 vector to translate by Returns:
out
