Quaterniond

Quaternion of 4 double-precision floats which can represent rotation and uniform scaling.

@author Richard Greenlees @author Kai Burjack

struct Quaterniond {}

Constructors

this
this(double x, double y, double z, double w)

Create a new {@link Quaterniond} and initialize its components to the given values.

this
this(Quaterniond source)

Create a new {@link Quaterniond} and initialize its components to the same values as the given {@link Quaterniond}.

this
this(AxisAngle4d axisAngle)

Create a new {@link Quaterniond} and initialize it to represent the same rotation as the given {@link AxisAngle4d}.

Members

Functions

add
Quaterniond add(double x, double y, double z, double w)

Add the quaternion <code>(x, y, z, w)</code> to this quaternion.

add
Quaterniond add(double x, double y, double z, double w, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
add
Quaterniond add(Quaterniond q2)

Add <code>q2</code> to this quaternion.

add
Quaterniond add(Quaterniond q2, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
angle
double angle()
Undocumented in source. Be warned that the author may not have intended to support it.
conjugate
Quaterniond conjugate(Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
conjugate
Quaterniond conjugate()

Conjugate this quaternion.

conjugateBy
Quaterniond conjugateBy(Quaterniond q, Quaterniond dest)

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>.

conjugateBy
Quaterniond conjugateBy(Quaterniond q)

Conjugate <code>this</code> by the given quaternion <code>q</code> by computing <code>q * this * q^-1</code>.

difference
Quaterniond difference(Quaterniond other, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
difference
Quaterniond difference(Quaterniond other)

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>.

div
Quaterniond div(Quaterniond b, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
div
Quaterniond div(Quaterniond b)

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>.

dot
double dot(Quaterniond otherQuat)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(Quaterniond q, double delta)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(Quaterniond other)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(double x, double y, double z, double w)
Undocumented in source. Be warned that the author may not have intended to support it.
fromAxisAngleDeg
Quaterniond fromAxisAngleDeg(Vector3d axis, double angle)

Set this quaternion to be a representation of the supplied axis and angle (in degrees).

fromAxisAngleDeg
Quaterniond fromAxisAngleDeg(double axisX, double axisY, double axisZ, double angle)

Set this quaternion to be a representation of the supplied axis and angle (in degrees).

fromAxisAngleRad
Quaterniond fromAxisAngleRad(Vector3d axis, double angle)

Set this quaternion to be a representation of the supplied axis and angle (in radians).

fromAxisAngleRad
Quaterniond fromAxisAngleRad(double axisX, double axisY, double axisZ, double angle)

Set this quaternion to be a representation of the supplied axis and angle (in radians).

get
Matrix3d get(Matrix3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
get
Quaterniond get(Quaterniond dest)

Set the given {@link Quaterniond} to the values of <code>this</code>.

get
AxisAngle4d get(AxisAngle4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
get
Matrix4d get(Matrix4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
getEulerAnglesXYZ
Vector3d getEulerAnglesXYZ(Vector3d eulerAngles)
Undocumented in source. Be warned that the author may not have intended to support it.
getEulerAnglesYXZ
Vector3d getEulerAnglesYXZ(Vector3d eulerAngles)
Undocumented in source. Be warned that the author may not have intended to support it.
getEulerAnglesZXY
Vector3d getEulerAnglesZXY(Vector3d eulerAngles)
Undocumented in source. Be warned that the author may not have intended to support it.
getEulerAnglesZYX
Vector3d getEulerAnglesZYX(Vector3d eulerAngles)
Undocumented in source. Be warned that the author may not have intended to support it.
hashCode
int hashCode()
Undocumented in source. Be warned that the author may not have intended to support it.
identity
Quaterniond identity()

Set this quaternion to the identity.

integrate
Quaterniond integrate(double dt, double vx, double vy, double vz)

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>

integrate
Quaterniond integrate(double dt, double vx, double vy, double vz, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
invert
Quaterniond invert(Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
invert
Quaterniond invert()

Invert this quaternion and {@link #normalize() normalize} it. <p> If this quaternion is already normalized, then {@link #conjugate()} should be used instead.

isFinite
bool isFinite()
Undocumented in source. Be warned that the author may not have intended to support it.
lengthSquared
double lengthSquared()
Undocumented in source. Be warned that the author may not have intended to support it.
lookAlong
Quaterniond lookAlong(double dirX, double dirY, double dirZ, double upX, double upY, double upZ, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
lookAlong
Quaterniond lookAlong(double dirX, double dirY, double dirZ, double upX, double upY, double upZ)

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>

lookAlong
Quaterniond lookAlong(Vector3d dir, Vector3d up, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
lookAlong
Quaterniond lookAlong(Vector3d dir, Vector3d up)

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>

mul
Quaterniond mul(Quaterniond q)

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>.

mul
Quaterniond mul(Quaterniond q, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
mul
Quaterniond mul(double qx, double qy, double qz, double qw)

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>.

mul
Quaterniond mul(double qx, double qy, double qz, double qw, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
nlerp
Quaterniond nlerp(Quaterniond q, double factor)

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>.

nlerp
Quaterniond nlerp(Quaterniond q, double factor, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
nlerpIterative
Quaterniond nlerpIterative(Quaterniond q, double alpha, double dotThreshold, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
nlerpIterative
Quaterniond nlerpIterative(Quaterniond q, double alpha, double dotThreshold)

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
Quaterniond normalize()

Normalize this quaternion.

normalize
Quaterniond normalize(Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
normalizedPositiveX
Vector3d normalizedPositiveX(Vector3d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
normalizedPositiveY
Vector3d normalizedPositiveY(Vector3d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
normalizedPositiveZ
Vector3d normalizedPositiveZ(Vector3d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
positiveX
Vector3d positiveX(Vector3d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
positiveY
Vector3d positiveY(Vector3d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
positiveZ
Vector3d positiveZ(Vector3d dir)
Undocumented in source. Be warned that the author may not have intended to support it.
premul
Quaterniond premul(Quaterniond q)

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>.

premul
Quaterniond premul(Quaterniond q, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
premul
Quaterniond premul(double qx, double qy, double qz, double qw)

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>.

premul
Quaterniond premul(double qx, double qy, double qz, double qw, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateAxis
Quaterniond rotateAxis(double angle, double axisX, double axisY, double axisZ)

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!

rotateAxis
Quaterniond rotateAxis(double angle, Vector3d axis)

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!

rotateAxis
Quaterniond rotateAxis(double angle, Vector3d axis, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateAxis
Quaterniond rotateAxis(double angle, double axisX, double axisY, double axisZ, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateLocalX
Quaterniond rotateLocalX(double angle, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateLocalX
Quaterniond rotateLocalX(double angle)

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!

rotateLocalY
Quaterniond rotateLocalY(double angle, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateLocalY
Quaterniond rotateLocalY(double angle)

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!

rotateLocalZ
Quaterniond rotateLocalZ(double angle, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateLocalZ
Quaterniond rotateLocalZ(double angle)

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!

rotateTo
Quaterniond rotateTo(Vector3d fromDir, Vector3d toDir)

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!

rotateTo
Quaterniond rotateTo(Vector3d fromDir, Vector3d toDir, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateTo
Quaterniond rotateTo(double fromDirX, double fromDirY, double fromDirZ, double toDirX, double toDirY, double toDirZ)

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!

rotateTo
Quaterniond rotateTo(double fromDirX, double fromDirY, double fromDirZ, double toDirX, double toDirY, double toDirZ, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateX
Quaterniond rotateX(double angle, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateX
Quaterniond rotateX(double angle)

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!

rotateXYZ
Quaterniond rotateXYZ(double angleX, double angleY, double angleZ, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateXYZ
Quaterniond rotateXYZ(double angleX, double angleY, double angleZ)

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!

rotateY
Quaterniond rotateY(double angle, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateY
Quaterniond rotateY(double angle)

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!

rotateYXZ
Quaterniond rotateYXZ(double angleY, double angleX, double angleZ, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateYXZ
Quaterniond rotateYXZ(double angleY, double angleX, double angleZ)

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!

rotateZ
Quaterniond rotateZ(double angle, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateZ
Quaterniond rotateZ(double angle)

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!

rotateZYX
Quaterniond rotateZYX(double angleZ, double angleY, double angleX, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
rotateZYX
Quaterniond rotateZYX(double angleZ, double angleY, double angleX)

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!

rotationAxis
Quaterniond rotationAxis(double angle, double axisX, double axisY, double axisZ)

Set this quaternion to a rotation of the given angle in radians about the supplied axis.

rotationTo
Quaterniond rotationTo(Vector3d fromDir, Vector3d toDir)

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.

rotationTo
Quaterniond rotationTo(double fromDirX, double fromDirY, double fromDirZ, double toDirX, double toDirY, double toDirZ)

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>

rotationX
Quaterniond rotationX(double angle)

Set this quaternion to represent a rotation of the given radians about the x axis.

rotationXYZ
Quaterniond rotationXYZ(double angleX, double angleY, double angleZ)

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>

rotationY
Quaterniond rotationY(double angle)

Set this quaternion to represent a rotation of the given radians about the y axis.

rotationYXZ
Quaterniond rotationYXZ(double angleY, double angleX, double angleZ)

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>

rotationZ
Quaterniond rotationZ(double angle)

Set this quaternion to represent a rotation of the given radians about the z axis.

rotationZYX
Quaterniond rotationZYX(double angleZ, double angleY, double angleX)

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>

scale
Quaterniond scale(double factor)

Apply scaling to this quaternion, which results in any vector transformed by this quaternion to change its length by the given <code>factor</code>.

scale
Quaterniond scale(double factor, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
scaling
Quaterniond scaling(double factor)

Set this quaternion to represent scaling, which results in a transformed vector to change its length by the given <code>factor</code>.

set
Quaterniond set(double x, double y, double z, double w)

Set this quaternion to the new values.

set
Quaterniond set(AxisAngle4d axisAngle)

Set this {@link Quaterniond} to be equivalent to the given {@link AxisAngle4d}.

set
Quaterniond set(Quaterniond q)

Set this quaternion to be a copy of q.

setAngleAxis
Quaterniond setAngleAxis(double angle, Vector3d axis)

Set this quaternion to be a representation of the supplied axis and angle (in radians).

setAngleAxis
Quaterniond setAngleAxis(double angle, double x, double y, double z)

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

setFromNormalized
Quaterniond setFromNormalized(Matrix3d mat)

Set this quaternion to be a representation of the rotational component of the given matrix.

setFromNormalized
Quaterniond setFromNormalized(Matrix4d mat)

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.

setFromNormalized
Quaterniond setFromNormalized(Matrix4x3d mat)

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.

setFromUnnormalized
Quaterniond setFromUnnormalized(Matrix3d mat)

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.

setFromUnnormalized
Quaterniond setFromUnnormalized(Matrix4d mat)

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.

setFromUnnormalized
Quaterniond setFromUnnormalized(Matrix4x3d mat)

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.

slerp
Quaterniond slerp(Quaterniond target, double alpha, Quaterniond dest)
Undocumented in source. Be warned that the author may not have intended to support it.
slerp
Quaterniond slerp(Quaterniond target, double alpha)

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>.

transform
Vector4d transform(double x, double y, double z, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transform
Vector4d transform(Vector4d vec, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transform
Vector3d transform(double x, double y, double z, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transform
Vector3d transform(Vector3d vec, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transform
Vector4d transform(Vector4d vec)
Undocumented in source. Be warned that the author may not have intended to support it.
transform
Vector3d transform(Vector3d vec)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverse
Vector4d transformInverse(double x, double y, double z, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverse
Vector4d transformInverse(Vector4d vec, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverse
Vector3d transformInverse(double x, double y, double z, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverse
Vector3d transformInverse(Vector3d vec, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverse
Vector4d transformInverse(Vector4d vec)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverse
Vector3d transformInverse(Vector3d vec)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverseUnit
Vector4d transformInverseUnit(double x, double y, double z, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverseUnit
Vector4d transformInverseUnit(Vector4d vec, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverseUnit
Vector3d transformInverseUnit(double x, double y, double z, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverseUnit
Vector3d transformInverseUnit(Vector3d vec, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverseUnit
Vector4d transformInverseUnit(Vector4d vec)
Undocumented in source. Be warned that the author may not have intended to support it.
transformInverseUnit
Vector3d transformInverseUnit(Vector3d vec)
Undocumented in source. Be warned that the author may not have intended to support it.
transformPositiveX
Vector4d transformPositiveX(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformPositiveX
Vector3d transformPositiveX(Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformPositiveY
Vector4d transformPositiveY(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformPositiveY
Vector3d transformPositiveY(Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformPositiveZ
Vector4d transformPositiveZ(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformPositiveZ
Vector3d transformPositiveZ(Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnit
Vector4d transformUnit(double x, double y, double z, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnit
Vector4d transformUnit(Vector4d vec, Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnit
Vector3d transformUnit(double x, double y, double z, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnit
Vector3d transformUnit(Vector3d vec, Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnit
Vector4d transformUnit(Vector4d vec)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnit
Vector3d transformUnit(Vector3d vec)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnitPositiveX
Vector4d transformUnitPositiveX(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnitPositiveX
Vector3d transformUnitPositiveX(Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnitPositiveY
Vector3d transformUnitPositiveY(Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnitPositiveY
Vector4d transformUnitPositiveY(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnitPositiveZ
Vector3d transformUnitPositiveZ(Vector3d dest)
Undocumented in source. Be warned that the author may not have intended to support it.
transformUnitPositiveZ
Vector4d transformUnitPositiveZ(Vector4d dest)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

nlerp
Quaterniond nlerp(Quaterniond[] qs, double[] weights, Quaterniond dest)

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>

nlerpIterative
Quaterniond nlerpIterative(Quaterniond[] qs, double[] weights, double dotThreshold, Quaterniond dest)

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>

slerp
Quaterniond slerp(Quaterniond[] qs, double[] weights, Quaterniond dest)

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>

Variables

w
double w;

The real/scalar part of the quaternion.

x
double x;

The first component of the vector part.

y
double y;

The second component of the vector part.

z
double z;

The third component of the vector part.

Meta