Create a new {@link Quaterniond} and initialize its components to the given values.
Create a new {@link Quaterniond} and initialize its components to the same values as the given {@link Quaterniond}.
Create a new {@link Quaterniond} and initialize it to represent the same rotation as the given {@link AxisAngle4d}.
Add the quaternion <code>(x, y, z, w)</code> to this quaternion.
Add <code>q2</code> to this quaternion.
Conjugate this quaternion.
Conjugate <code>this</code> by the given quaternion <code>q</code> by computing <code>q * this * q^-1</code> and store the result into <code>dest</code>.
Conjugate <code>this</code> by the given quaternion <code>q</code> by computing <code>q * this * q^-1</code>.
Compute the difference between <code>this</code> and the <code>other</code> quaternion and store the result in <code>this</code>. <p> The difference is the rotation that has to be applied to get from <code>this</code> rotation to <code>other</code>. If <code>T</code> is <code>this</code>, <code>Q</code> is <code>other</code> and <code>D</code> is the computed difference, then the following equation holds: <p> <code>T * D = Q</code> <p> It is defined as: <code>D = T^-1 * Q</code>, where <code>T^-1</code> denotes the {@link #invert() inverse} of <code>T</code>.
Divide <code>this</code> quaternion by <code>b</code>. <p> The division expressed using the inverse is performed in the following way: <p> <code>this = this * b^-1</code>, where <code>b^-1</code> is the inverse of <code>b</code>.
Set this quaternion to be a representation of the supplied axis and angle (in degrees).
Set this quaternion to be a representation of the supplied axis and angle (in degrees).
Set this quaternion to be a representation of the supplied axis and angle (in radians).
Set this quaternion to be a representation of the supplied axis and angle (in radians).
Set the given {@link Quaterniond} to the values of <code>this</code>.
Set this quaternion to the identity.
Integrate the rotation given by the angular velocity <code>(vx, vy, vz)</code> around the x, y and z axis, respectively, with respect to the given elapsed time delta <code>dt</code> and add the differentiate rotation to the rotation represented by this quaternion. <p> This method pre-multiplies the rotation given by <code>dt</code> and <code>(vx, vy, vz)</code> by <code>this</code>, so the angular velocities are always relative to the local coordinate system of the rotation represented by <code>this</code> quaternion. <p> This method is equivalent to calling: <code>rotateLocal(dt * vx, dt * vy, dt * vz)</code> <p> Reference: <a href="http://physicsforgames.blogspot.de/2010/02/quaternions.html">http://physicsforgames.blogspot.de/</a>
Invert this quaternion and {@link #normalize() normalize} it. <p> If this quaternion is already normalized, then {@link #conjugate()} should be used instead.
Apply a rotation to this quaternion that maps the given direction to the positive Z axis. <p> Because there are multiple possibilities for such a rotation, this method will choose the one that ensures the given up direction to remain parallel to the plane spanned by the <code>up</code> and <code>dir</code> vectors. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first! <p> Reference: <a href="http://answers.unity3d.com/questions/467614/what-is-the-source-code-of-quaternionlookrotation.html">http://answers.unity3d.com</a>
Apply a rotation to this quaternion that maps the given direction to the positive Z axis. <p> Because there are multiple possibilities for such a rotation, this method will choose the one that ensures the given up direction to remain parallel to the plane spanned by the <code>up</code> and <code>dir</code> vectors. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first! <p> Reference: <a href="http://answers.unity3d.com/questions/467614/what-is-the-source-code-of-quaternionlookrotation.html">http://answers.unity3d.com</a>
Multiply this quaternion by <code>q</code>. <p> If <code>T</code> is <code>this</code> and <code>Q</code> is the given quaternion, then the resulting quaternion <code>R</code> is: <p> <code>R = T * Q</code> <p> So, this method uses post-multiplication like the matrix classes, resulting in a vector to be transformed by <code>Q</code> first, and then by <code>T</code>.
Multiply this quaternion by the quaternion represented via <code>(qx, qy, qz, qw)</code>. <p> If <code>T</code> is <code>this</code> and <code>Q</code> is the given quaternion, then the resulting quaternion <code>R</code> is: <p> <code>R = T * Q</code> <p> So, this method uses post-multiplication like the matrix classes, resulting in a vector to be transformed by <code>Q</code> first, and then by <code>T</code>.
Compute a linear (non-spherical) interpolation of <code>this</code> and the given quaternion <code>q</code> and store the result in <code>this</code>.
Compute linear (non-spherical) interpolations of <code>this</code> and the given quaternion <code>q</code> iteratively and store the result in <code>this</code>. <p> This method performs a series of small-step nlerp interpolations to avoid doing a costly spherical linear interpolation, like {@link #slerp(Quaterniond, double, Quaterniond) slerp}, by subdividing the rotation arc between <code>this</code> and <code>q</code> via non-spherical linear interpolations as long as the absolute dot product of <code>this</code> and <code>q</code> is greater than the given <code>dotThreshold</code> parameter. <p> Thanks to <code>@theagentd</code> at <a href="http://www.java-gaming.org/">http://www.java-gaming.org/</a> for providing the code.
Normalize this quaternion.
Pre-multiply this quaternion by <code>q</code>. <p> If <code>T</code> is <code>this</code> and <code>Q</code> is the given quaternion, then the resulting quaternion <code>R</code> is: <p> <code>R = Q * T</code> <p> So, this method uses pre-multiplication, resulting in a vector to be transformed by <code>T</code> first, and then by <code>Q</code>.
Pre-multiply this quaternion by the quaternion represented via <code>(qx, qy, qz, qw)</code>. <p> If <code>T</code> is <code>this</code> and <code>Q</code> is the given quaternion, then the resulting quaternion <code>R</code> is: <p> <code>R = Q * T</code> <p> So, this method uses pre-multiplication, resulting in a vector to be transformed by <code>T</code> first, and then by <code>Q</code>.
Apply a rotation to <code>this</code> quaternion rotating the given radians about the specified axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the specified axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the local x axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>R * Q</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>R * Q * v</code>, the rotation represented by <code>this</code> will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the local y axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>R * Q</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>R * Q * v</code>, the rotation represented by <code>this</code> will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the local z axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>R * Q</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>R * Q * v</code>, the rotation represented by <code>this</code> will be applied first!
Apply a rotation to <code>this</code> that rotates the <code>fromDir</code> vector to point along <code>toDir</code>. <p> Because there can be multiple possible rotations, this method chooses the one with the shortest arc. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> that rotates the <code>fromDir</code> vector to point along <code>toDir</code>. <p> Since there can be multiple possible rotations, this method chooses the one with the shortest arc. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the x axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the cartesian base unit axes, called the euler angles using rotation sequence <code>XYZ</code>. <p> This method is equivalent to calling: <code>rotateX(angleX).rotateY(angleY).rotateZ(angleZ)</code> <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the y axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the cartesian base unit axes, called the euler angles, using the rotation sequence <code>YXZ</code>. <p> This method is equivalent to calling: <code>rotateY(angleY).rotateX(angleX).rotateZ(angleZ)</code> <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the z axis. <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Apply a rotation to <code>this</code> quaternion rotating the given radians about the cartesian base unit axes, called the euler angles, using the rotation sequence <code>ZYX</code>. <p> This method is equivalent to calling: <code>rotateZ(angleZ).rotateY(angleY).rotateX(angleX)</code> <p> If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representing the specified rotation, then the new quaternion will be <code>Q * R</code>. So when transforming a vector <code>v</code> with the new quaternion by using <code>Q * R * v</code>, the rotation added by this method will be applied first!
Set this quaternion to a rotation of the given angle in radians about the supplied axis.
Set <code>this</code> quaternion to a rotation that rotates the <code>fromDir</code> vector to point along <code>toDir</code>. <p> Because there can be multiple possible rotations, this method chooses the one with the shortest arc.
Set <code>this</code> quaternion to a rotation that rotates the <code>fromDir</code> vector to point along <code>toDir</code>. <p> Since there can be multiple possible rotations, this method chooses the one with the shortest arc. <p> Reference: <a href="http://stackoverflow.com/questions/1171849/finding-quaternion-representing-the-rotation-from-one-vector-to-another#answer-1171995">stackoverflow.com</a>
Set this quaternion to represent a rotation of the given radians about the x axis.
Set this quaternion from the supplied euler angles (in radians) with rotation order XYZ. <p> This method is equivalent to calling: <code>rotationX(angleX).rotateY(angleY).rotateZ(angleZ)</code> <p> Reference: <a href="http://gamedev.stackexchange.com/questions/13436/glm-euler-angles-to-quaternion#answer-13446">this stackexchange answer</a>
Set this quaternion to represent a rotation of the given radians about the y axis.
Set this quaternion from the supplied euler angles (in radians) with rotation order YXZ. <p> This method is equivalent to calling: <code>rotationY(angleY).rotateX(angleX).rotateZ(angleZ)</code> <p> Reference: <a href="https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles">https://en.wikipedia.org</a>
Set this quaternion to represent a rotation of the given radians about the z axis.
Set this quaternion from the supplied euler angles (in radians) with rotation order ZYX. <p> This method is equivalent to calling: <code>rotationZ(angleZ).rotateY(angleY).rotateX(angleX)</code> <p> Reference: <a href="http://gamedev.stackexchange.com/questions/13436/glm-euler-angles-to-quaternion#answer-13446">this stackexchange answer</a>
Apply scaling to this quaternion, which results in any vector transformed by this quaternion to change its length by the given <code>factor</code>.
Set this quaternion to represent scaling, which results in a transformed vector to change its length by the given <code>factor</code>.
Set this quaternion to the new values.
Set this {@link Quaterniond} to be equivalent to the given {@link AxisAngle4d}.
Set this quaternion to be a copy of q.
Set this quaternion to be a representation of the supplied axis and angle (in radians).
Set this quaternion to a rotation equivalent to the supplied axis and angle (in radians). <p> This method assumes that the given rotation axis <code>(x, y, z)</code> is already normalized
Set this quaternion to be a representation of the rotational component of the given matrix.
Set this quaternion to be a representation of the rotational component of the given matrix. <p> This method assumes that the first three columns of the upper left 3x3 submatrix are unit vectors.
Set this quaternion to be a representation of the rotational component of the given matrix. <p> This method assumes that the first three columns of the upper left 3x3 submatrix are unit vectors.
Set this quaternion to be a representation of the rotational component of the given matrix. <p> This method assumes that the first three columns of the upper left 3x3 submatrix are no unit vectors.
Set this quaternion to be a representation of the rotational component of the given matrix. <p> This method assumes that the first three columns of the upper left 3x3 submatrix are no unit vectors.
Set this quaternion to be a representation of the rotational component of the given matrix. <p> This method assumes that the first three columns of the upper left 3x3 submatrix are no unit vectors.
Interpolate between <code>this</code> {@link #normalize() unit} quaternion and the specified <code>target</code> {@link #normalize() unit} quaternion using spherical linear interpolation using the specified interpolation factor <code>alpha</code>. <p> This method resorts to non-spherical linear interpolation when the absolute dot product between <code>this</code> and <code>target</code> is below <code>1E-6</code>.
Interpolate between all of the quaternions given in <code>qs</code> via non-spherical linear interpolation using the specified interpolation factors <code>weights</code>, and store the result in <code>dest</code>. <p> This method will interpolate between each two successive quaternions via {@link #nlerp(Quaterniond, double)} using their relative interpolation weights. <p> Reference: <a href="http://gamedev.stackexchange.com/questions/62354/method-for-interpolation-between-3-quaternions#answer-62356">http://gamedev.stackexchange.com/</a>
Interpolate between all of the quaternions given in <code>qs</code> via iterative non-spherical linear interpolation using the specified interpolation factors <code>weights</code>, and store the result in <code>dest</code>. <p> This method will interpolate between each two successive quaternions via {@link #nlerpIterative(Quaterniond, double, double)} using their relative interpolation weights. <p> Reference: <a href="http://gamedev.stackexchange.com/questions/62354/method-for-interpolation-between-3-quaternions#answer-62356">http://gamedev.stackexchange.com/</a>
Interpolate between all of the quaternions given in <code>qs</code> via spherical linear interpolation using the specified interpolation factors <code>weights</code>, and store the result in <code>dest</code>. <p> This method will interpolate between each two successive quaternions via {@link #slerp(Quaterniond, double)} using their relative interpolation weights. <p> This method resorts to non-spherical linear interpolation when the absolute dot product of any two interpolated quaternions is below <code>1E-6f</code>. <p> Reference: <a href="http://gamedev.stackexchange.com/questions/62354/method-for-interpolation-between-3-quaternions#answer-62356">http://gamedev.stackexchange.com/</a>
Quaternion of 4 double-precision floats which can represent rotation and uniform scaling.
@author Richard Greenlees @author Kai Burjack