Interface Quaternionfc
- All Known Implementing Classes:
 Quaternionf
- Author:
 - Kai Burjack
 
- 
Method Summary
Modifier and TypeMethodDescriptionadd(float x, float y, float z, float w, Quaternionf dest) Add the quaternion(x, y, z, w)to this quaternion and store the result indest.add(Quaternionfc q2, Quaternionf dest) Addq2to this quaternion and store the result indest.floatangle()Return the angle in radians represented by this normalized quaternion rotation.conjugate(Quaternionf dest) Conjugate this quaternion and store the result indest.conjugateBy(Quaternionfc q, Quaternionf dest) Conjugatethisby the given quaternionqby computingq * this * q^-1and store the result intodest.difference(Quaternionfc other, Quaternionf dest) Compute the difference betweenthisand theotherquaternion and store the result indest.div(Quaternionfc b, Quaternionf dest) Dividethisquaternion byband store the result indest.booleanequals(float x, float y, float z, float w) booleanequals(Quaternionfc q, float delta) Compare the quaternion components ofthisquaternion with the given quaternion using the givendeltaand return whether all of them are equal within a maximum difference ofdelta.get(AxisAngle4d dest) Set the givenAxisAngle4dto represent the rotation ofthisquaternion.get(AxisAngle4f dest) Set the givenAxisAngle4fto represent the rotation ofthisquaternion.Set the given destination matrix to the rotation represented bythis.Set the given destination matrix to the rotation represented bythis.Set the given destination matrix to the rotation represented bythis.Set the given destination matrix to the rotation represented bythis.get(Matrix4x3d dest) Set the given destination matrix to the rotation represented bythis.get(Matrix4x3f dest) Set the given destination matrix to the rotation represented bythis.get(Quaterniond dest) Set the givenQuaterniondto the values ofthis.get(Quaternionf dest) Set the givenQuaternionfto the values ofthis.getAsMatrix3f(ByteBuffer dest) Store the 3x3 float matrix representation ofthisquaternion in column-major order into the givenByteBuffer.getAsMatrix3f(FloatBuffer dest) Store the 3x3 float matrix representation ofthisquaternion in column-major order into the givenFloatBuffer.getAsMatrix4f(ByteBuffer dest) Store the 4x4 float matrix representation ofthisquaternion in column-major order into the givenByteBuffer.getAsMatrix4f(FloatBuffer dest) Store the 4x4 float matrix representation ofthisquaternion in column-major order into the givenFloatBuffer.getAsMatrix4x3f(ByteBuffer dest) Store the 4x3 float matrix representation ofthisquaternion in column-major order into the givenByteBuffer.getAsMatrix4x3f(FloatBuffer dest) Store the 4x3 float matrix representation ofthisquaternion in column-major order into the givenFloatBuffer.getEulerAnglesXYZ(Vector3f eulerAngles) Get the euler angles in radians in rotation sequenceXYZof this quaternion and store them in the provided parametereulerAngles.getEulerAnglesYXZ(Vector3f eulerAngles) Get the euler angles in radians in rotation sequenceYXZof this quaternion and store them in the provided parametereulerAngles.getEulerAnglesZXY(Vector3f eulerAngles) Get the euler angles in radians in rotation sequenceZXYof this quaternion and store them in the provided parametereulerAngles.getEulerAnglesZYX(Vector3f eulerAngles) Get the euler angles in radians in rotation sequenceZYXof this quaternion and store them in the provided parametereulerAngles.integrate(float dt, float vx, float vy, float vz, Quaternionf dest) Integrate the rotation given by the angular velocity(vx, vy, vz)around the x, y and z axis, respectively, with respect to the given elapsed time deltadtand add the differentiate rotation to the rotation represented by this quaternion and store the result intodest.invert(Quaternionf dest) Invert this quaternion and store thenormalizedresult indest.booleanisFinite()floatReturn the square of the length of this quaternion.lookAlong(float dirX, float dirY, float dirZ, float upX, float upY, float upZ, Quaternionf dest) Apply a rotation to this quaternion that maps the given direction to the positive Z axis, and store the result indest.lookAlong(Vector3fc dir, Vector3fc up, Quaternionf dest) Apply a rotation to this quaternion that maps the given direction to the positive Z axis, and store the result indest.mul(float qx, float qy, float qz, float qw, Quaternionf dest) Multiply this quaternion by the quaternion represented via(qx, qy, qz, qw)and store the result indest.mul(float f, Quaternionf dest) Multiply this quaternion by the given scalar and store the result indest.mul(Quaternionfc q, Quaternionf dest) Multiply this quaternion byqand store the result indest.nlerp(Quaternionfc q, float factor, Quaternionf dest) Compute a linear (non-spherical) interpolation ofthisand the given quaternionqand store the result indest.nlerpIterative(Quaternionfc q, float alpha, float dotThreshold, Quaternionf dest) Compute linear (non-spherical) interpolations ofthisand the given quaternionqiteratively and store the result indest.normalize(Quaternionf dest) Normalize this quaternion and store the result indest.Obtain the direction of+Xbefore the rotation transformation represented bythisnormalized quaternion is applied.Obtain the direction of+Ybefore the rotation transformation represented bythisnormalized quaternion is applied.Obtain the direction of+Zbefore the rotation transformation represented bythisnormalized quaternion is applied.Obtain the direction of+Xbefore the rotation transformation represented bythisquaternion is applied.Obtain the direction of+Ybefore the rotation transformation represented bythisquaternion is applied.Obtain the direction of+Zbefore the rotation transformation represented bythisquaternion is applied.premul(float qx, float qy, float qz, float qw, Quaternionf dest) Pre-multiply this quaternion by the quaternion represented via(qx, qy, qz, qw)and store the result indest.premul(Quaternionfc q, Quaternionf dest) Pre-multiply this quaternion byqand store the result indest.rotateAxis(float angle, float axisX, float axisY, float axisZ, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the specified axis and store the result indest.rotateAxis(float angle, Vector3fc axis, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the specified axis and store the result indest.rotateLocalX(float angle, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the local x axis and store the result indest.rotateLocalY(float angle, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the local y axis and store the result indest.rotateLocalZ(float angle, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the local z axis and store the result indest.rotateTo(float fromDirX, float fromDirY, float fromDirZ, float toDirX, float toDirY, float toDirZ, Quaternionf dest) Apply a rotation tothisthat rotates thefromDirvector to point alongtoDirand store the result indest.rotateTo(Vector3fc fromDir, Vector3fc toDir, Quaternionf dest) Apply a rotation tothisthat rotates thefromDirvector to point alongtoDirand store the result indest.rotateX(float angle, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the x axis and store the result indest.rotateXYZ(float angleX, float angleY, float angleZ, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the cartesian base unit axes, called the euler angles using rotation sequenceXYZand store the result indest.rotateY(float angle, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the y axis and store the result indest.rotateYXZ(float angleY, float angleX, float angleZ, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the cartesian base unit axes, called the euler angles, using the rotation sequenceYXZand store the result indest.rotateZ(float angle, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the z axis and store the result indest.rotateZYX(float angleZ, float angleY, float angleX, Quaternionf dest) Apply a rotation tothisquaternion rotating the given radians about the cartesian base unit axes, called the euler angles, using the rotation sequenceZYXand store the result indest.scale(float factor, Quaternionf dest) Apply scaling to this quaternion, which results in any vector transformed by the quaternion to change its length by the givenfactor, and store the result indest.slerp(Quaternionfc target, float alpha, Quaternionf dest) Transform the given vector(x, y, z)by this quaternion and store the result indest.Transform the given vector(x, y, z)by this quaternion and store the result indest.Transform the given vector(x, y, z)by this quaternion and store the result indest.Transform the given vector(x, y, z)by this quaternion and store the result indest.Transform the given vector(x, y, z)by this quaternion and store the result indest.Transform the given vector by this quaternion.Transform the given vector by this quaternion and store the result indest.Transform the given vector by this quaternion.Transform the given vector by this quaternion and store the result indest.Transform the given vector by this quaternion.Transform the given vector by this quaternion and store the result indest.Transform the given vector by this quaternion.Transform the given vector by this quaternion and store the result indest.transformInverse(double x, double y, double z, Vector3d dest) Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.transformInverse(double x, double y, double z, Vector4d dest) Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.transformInverse(float x, float y, float z, Vector3d dest) Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.transformInverse(float x, float y, float z, Vector3f dest) Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.transformInverse(float x, float y, float z, Vector4f dest) Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.transformInverse(Vector3d vec) Transform the given vector by the inverse of this quaternion.transformInverse(Vector3dc vec, Vector3d dest) Transform the given vector by the inverse of this quaternion and store the result indest.transformInverse(Vector3f vec) Transform the given vector by the inverse of this quaternion.transformInverse(Vector3fc vec, Vector3f dest) Transform the given vector by the inverse of quaternion and store the result indest.transformInverse(Vector4d vec) Transform the given vector by the inverse of this quaternion.transformInverse(Vector4dc vec, Vector4d dest) Transform the given vector by the inverse of this quaternion and store the result indest.transformInverse(Vector4f vec) Transform the given vector by the inverse of this quaternion.transformInverse(Vector4fc vec, Vector4f dest) Transform the given vector by the inverse of this quaternion and store the result indest.transformInverseUnit(double x, double y, double z, Vector3d dest) Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.transformInverseUnit(double x, double y, double z, Vector4d dest) Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.transformInverseUnit(float x, float y, float z, Vector3d dest) Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.transformInverseUnit(float x, float y, float z, Vector3f dest) Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.transformInverseUnit(float x, float y, float z, Vector4f dest) Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.transformInverseUnit(Vector3dc vec, Vector3d dest) Transform the given vector by the inverse of this unit quaternion and store the result indest.Transform the given vector by the inverse of this unit quaternion.transformInverseUnit(Vector3fc vec, Vector3f dest) Transform the given vector by the inverse of this unit quaternion and store the result indest.Transform the given vector by the inverse of this unit quaternion.transformInverseUnit(Vector4dc vec, Vector4d dest) Transform the given vector by the inverse of this unit quaternion and store the result indest.Transform the given vector by the inverse of this unit quaternion.transformInverseUnit(Vector4fc vec, Vector4f dest) Transform the given vector by the inverse of this unit quaternion and store the result indest.transformPositiveX(Vector3d dest) Transform the vector(1, 0, 0)by this quaternion.transformPositiveX(Vector3f dest) Transform the vector(1, 0, 0)by this quaternion.transformPositiveX(Vector4d dest) Transform the vector(1, 0, 0)by this quaternion.transformPositiveX(Vector4f dest) Transform the vector(1, 0, 0)by this quaternion.transformPositiveY(Vector3d dest) Transform the vector(0, 1, 0)by this quaternion.transformPositiveY(Vector3f dest) Transform the vector(0, 1, 0)by this quaternion.transformPositiveY(Vector4d dest) Transform the vector(0, 1, 0)by this quaternion.transformPositiveY(Vector4f dest) Transform the vector(0, 1, 0)by this quaternion.transformPositiveZ(Vector3d dest) Transform the vector(0, 0, 1)by this quaternion.transformPositiveZ(Vector3f dest) Transform the vector(0, 0, 1)by this quaternion.transformPositiveZ(Vector4d dest) Transform the vector(0, 0, 1)by this quaternion.transformPositiveZ(Vector4f dest) Transform the vector(0, 0, 1)by this quaternion.transformUnit(double x, double y, double z, Vector3d dest) Transform the given vector(x, y, z)by this unit quaternion and store the result indest.transformUnit(double x, double y, double z, Vector4d dest) Transform the given vector(x, y, z)by this unit quaternion and store the result indest.transformUnit(float x, float y, float z, Vector3d dest) Transform the given vector(x, y, z)by this unit quaternion and store the result indest.transformUnit(float x, float y, float z, Vector3f dest) Transform the given vector(x, y, z)by this unit quaternion and store the result indest.transformUnit(float x, float y, float z, Vector4f dest) Transform the given vector(x, y, z)by this unit quaternion and store the result indest.transformUnit(Vector3dc vec, Vector3d dest) Transform the given vector by this unit quaternion and store the result indest.transformUnit(Vector3f vec) Transform the given vector by this unit quaternion.transformUnit(Vector3fc vec, Vector3f dest) Transform the given vector by this unit quaternion and store the result indest.transformUnit(Vector4d vec) Transform the given vector by this unit quaternion.transformUnit(Vector4dc vec, Vector4d dest) Transform the given vector by this unit quaternion and store the result indest.transformUnit(Vector4f vec) Transform the given vector by this unit quaternion.transformUnit(Vector4fc vec, Vector4f dest) Transform the given vector by this unit quaternion and store the result indest.Transform the vector(1, 0, 0)by this unit quaternion.Transform the vector(1, 0, 0)by this unit quaternion.Transform the vector(1, 0, 0)by this unit quaternion.Transform the vector(1, 0, 0)by this unit quaternion.Transform the vector(0, 1, 0)by this unit quaternion.Transform the vector(0, 1, 0)by this unit quaternion.Transform the vector(0, 1, 0)by this unit quaternion.Transform the vector(0, 1, 0)by this unit quaternion.Transform the vector(0, 0, 1)by this unit quaternion.Transform the vector(0, 0, 1)by this unit quaternion.Transform the vector(0, 0, 1)by this unit quaternion.Transform the vector(0, 0, 1)by this unit quaternion.floatw()floatx()floaty()floatz() 
- 
Method Details
- 
x
float x()- Returns:
 - the first component of the vector part
 
 - 
y
float y()- Returns:
 - the second component of the vector part
 
 - 
z
float z()- Returns:
 - the third component of the vector part
 
 - 
w
float w()- Returns:
 - the real/scalar part of the quaternion
 
 - 
normalize
Normalize this quaternion and store the result indest.- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
add
Add the quaternion(x, y, z, w)to this quaternion and store the result indest.- Parameters:
 x- the x component of the vector party- the y component of the vector partz- the z component of the vector partw- the real/scalar componentdest- will hold the result- Returns:
 - dest
 
 - 
add
Addq2to this quaternion and store the result indest.- Parameters:
 q2- the quaternion to add to thisdest- will hold the result- Returns:
 - dest
 
 - 
angle
float angle()Return the angle in radians represented by this normalized quaternion rotation.This quaternion must be
normalized.- Returns:
 - the angle in radians
 
 - 
get
Set the given destination matrix to the rotation represented bythis.- Parameters:
 dest- the matrix to write the rotation into- Returns:
 - the passed in destination
 - See Also:
 
 - 
get
Set the given destination matrix to the rotation represented bythis.- Parameters:
 dest- the matrix to write the rotation into- Returns:
 - the passed in destination
 - See Also:
 
 - 
get
Set the given destination matrix to the rotation represented bythis.- Parameters:
 dest- the matrix to write the rotation into- Returns:
 - the passed in destination
 - See Also:
 
 - 
get
Set the given destination matrix to the rotation represented bythis.- Parameters:
 dest- the matrix to write the rotation into- Returns:
 - the passed in destination
 - See Also:
 
 - 
get
Set the given destination matrix to the rotation represented bythis.- Parameters:
 dest- the matrix to write the rotation into- Returns:
 - the passed in destination
 - See Also:
 
 - 
get
Set the given destination matrix to the rotation represented bythis.- Parameters:
 dest- the matrix to write the rotation into- Returns:
 - the passed in destination
 - See Also:
 
 - 
get
Set the givenAxisAngle4fto represent the rotation ofthisquaternion.- Parameters:
 dest- theAxisAngle4fto set- Returns:
 - the passed in destination
 
 - 
get
Set the givenAxisAngle4dto represent the rotation ofthisquaternion.- Parameters:
 dest- theAxisAngle4dto set- Returns:
 - the passed in destination
 
 - 
get
Set the givenQuaterniondto the values ofthis.- Parameters:
 dest- theQuaterniondto set- Returns:
 - the passed in destination
 - See Also:
 
 - 
get
Set the givenQuaternionfto the values ofthis.- Parameters:
 dest- theQuaternionfto set- Returns:
 - the passed in destination
 
 - 
getAsMatrix3f
Store the 3x3 float matrix representation ofthisquaternion in column-major order into the givenByteBuffer.This is equivalent to calling:
this.get(new Matrix3f()).get(dest)- Parameters:
 dest- the destination buffer- Returns:
 - dest
 
 - 
getAsMatrix3f
Store the 3x3 float matrix representation ofthisquaternion in column-major order into the givenFloatBuffer.This is equivalent to calling:
this.get(new Matrix3f()).get(dest)- Parameters:
 dest- the destination buffer- Returns:
 - dest
 
 - 
getAsMatrix4f
Store the 4x4 float matrix representation ofthisquaternion in column-major order into the givenByteBuffer.This is equivalent to calling:
this.get(new Matrix4f()).get(dest)- Parameters:
 dest- the destination buffer- Returns:
 - dest
 
 - 
getAsMatrix4f
Store the 4x4 float matrix representation ofthisquaternion in column-major order into the givenFloatBuffer.This is equivalent to calling:
this.get(new Matrix4f()).get(dest)- Parameters:
 dest- the destination buffer- Returns:
 - dest
 
 - 
getAsMatrix4x3f
Store the 4x3 float matrix representation ofthisquaternion in column-major order into the givenByteBuffer.This is equivalent to calling:
this.get(new Matrix4x3f()).get(dest)- Parameters:
 dest- the destination buffer- Returns:
 - dest
 
 - 
getAsMatrix4x3f
Store the 4x3 float matrix representation ofthisquaternion in column-major order into the givenFloatBuffer.This is equivalent to calling:
this.get(new Matrix4x3f()).get(dest)- Parameters:
 dest- the destination buffer- Returns:
 - dest
 
 - 
mul
Multiply this quaternion byqand store the result indest.If
TisthisandQis the given quaternion, then the resulting quaternionRis:R = T * QSo, this method uses post-multiplication like the matrix classes, resulting in a vector to be transformed by
Qfirst, and then byT.- Parameters:
 q- the quaternion to multiplythisbydest- will hold the result- Returns:
 - dest
 
 - 
mul
Multiply this quaternion by the quaternion represented via(qx, qy, qz, qw)and store the result indest.If
TisthisandQis the given quaternion, then the resulting quaternionRis:R = T * QSo, this method uses post-multiplication like the matrix classes, resulting in a vector to be transformed by
Qfirst, and then byT.- Parameters:
 qx- the x component of the quaternion to multiplythisbyqy- the y component of the quaternion to multiplythisbyqz- the z component of the quaternion to multiplythisbyqw- the w component of the quaternion to multiplythisbydest- will hold the result- Returns:
 - dest
 
 - 
mul
Multiply this quaternion by the given scalar and store the result indest.This method multiplies all of the four components by the specified scalar.
- Parameters:
 f- the factor to multiply all components bydest- will hold the result- Returns:
 - dest
 
 - 
premul
Pre-multiply this quaternion byqand store the result indest.If
TisthisandQis the given quaternion, then the resulting quaternionRis:R = Q * TSo, this method uses pre-multiplication, resulting in a vector to be transformed by
Tfirst, and then byQ.- Parameters:
 q- the quaternion to pre-multiplythisbydest- will hold the result- Returns:
 - dest
 
 - 
premul
Pre-multiply this quaternion by the quaternion represented via(qx, qy, qz, qw)and store the result indest.If
TisthisandQis the given quaternion, then the resulting quaternionRis:R = Q * TSo, this method uses pre-multiplication, resulting in a vector to be transformed by
Tfirst, and then byQ.- Parameters:
 qx- the x component of the quaternion to multiplythisbyqy- the y component of the quaternion to multiplythisbyqz- the z component of the quaternion to multiplythisbyqw- the w component of the quaternion to multiplythisbydest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector by this quaternion.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformInverse
Transform the given vector by the inverse of this quaternion.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformUnit
Transform the given vector by this unit quaternion.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformPositiveX
Transform the vector(1, 0, 0)by this quaternion.- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveX
Transform the vector(1, 0, 0)by this quaternion.Only the first three components of the given 4D vector are modified.
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveX
Transform the vector(1, 0, 0)by this unit quaternion.This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveX
Transform the vector(1, 0, 0)by this unit quaternion.Only the first three components of the given 4D vector are modified.
This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveY
Transform the vector(0, 1, 0)by this quaternion.- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveY
Transform the vector(0, 1, 0)by this quaternion.Only the first three components of the given 4D vector are modified.
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveY
Transform the vector(0, 1, 0)by this unit quaternion.This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveY
Transform the vector(0, 1, 0)by this unit quaternion.Only the first three components of the given 4D vector are modified.
This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveZ
Transform the vector(0, 0, 1)by this quaternion.- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveZ
Transform the vector(0, 0, 1)by this quaternion.Only the first three components of the given 4D vector are modified.
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveZ
Transform the vector(0, 0, 1)by this unit quaternion.This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveZ
Transform the vector(0, 0, 1)by this unit quaternion.Only the first three components of the given 4D vector are modified.
This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector by this quaternion.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and modified.
- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformInverse
Transform the given vector by the inverse of this quaternion.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and modified.
- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transform
Transform the given vector by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector by the inverse of quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector(x, y, z)by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector(x, y, z)by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector by the inverse of this unit quaternion.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformUnit
Transform the given vector by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector(x, y, z)by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector(x, y, z)by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector by the inverse of this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector(x, y, z)by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector by this unit quaternion.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformInverseUnit
Transform the given vector by the inverse of this unit quaternion.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformInverseUnit
Transform the given vector by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector(x, y, z)by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector by this quaternion.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformInverse
Transform the given vector by the inverse of this quaternion.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformPositiveX
Transform the vector(1, 0, 0)by this quaternion.- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveX
Transform the vector(1, 0, 0)by this quaternion.Only the first three components of the given 4D vector are modified.
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveX
Transform the vector(1, 0, 0)by this unit quaternion.This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveX
Transform the vector(1, 0, 0)by this unit quaternion.Only the first three components of the given 4D vector are modified.
This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveY
Transform the vector(0, 1, 0)by this quaternion.- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveY
Transform the vector(0, 1, 0)by this quaternion.Only the first three components of the given 4D vector are modified.
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveY
Transform the vector(0, 1, 0)by this unit quaternion.This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveY
Transform the vector(0, 1, 0)by this unit quaternion.Only the first three components of the given 4D vector are modified.
This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveZ
Transform the vector(0, 0, 1)by this quaternion.- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformPositiveZ
Transform the vector(0, 0, 1)by this quaternion.Only the first three components of the given 4D vector are modified.
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveZ
Transform the vector(0, 0, 1)by this unit quaternion.This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transformUnitPositiveZ
Transform the vector(0, 0, 1)by this unit quaternion.Only the first three components of the given 4D vector are modified.
This method is only applicable when
thisis a unit quaternion.Reference: https://de.mathworks.com/
- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector by this quaternion.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and modified.
- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformInverse
Transform the given vector by the inverse of this quaternion.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and modified.
- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transform
Transform the given vector by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector by the inverse of this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector(x, y, z)by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector by the inverse of this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transform
Transform the given vector(x, y, z)by this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverse
Transform the given vector(x, y, z)by the inverse of this quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector by this unit quaternion.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and modified.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformInverseUnit
Transform the given vector by the inverse of this unit quaternion.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and modified.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transform- Returns:
 - vec
 
 - 
transformUnit
Transform the given vector by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector(x, y, z)by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
Only the first three components of the given 4D vector are being used and set on the destination.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 vec- the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformUnit
Transform the given vector(x, y, z)by this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
transformInverseUnit
Transform the given vector(x, y, z)by the inverse of this unit quaternion and store the result indest.This will apply the rotation described by this quaternion to the given vector.
This method is only applicable when
thisis a unit quaternion.- Parameters:
 x- the x coordinate of the vector to transformy- the y coordinate of the vector to transformz- the z coordinate of the vector to transformdest- will hold the result- Returns:
 - dest
 
 - 
invert
Invert this quaternion and store thenormalizedresult indest.If this quaternion is already normalized, then
conjugate(Quaternionf)should be used instead.- Parameters:
 dest- will hold the result- Returns:
 - dest
 - See Also:
 
 - 
div
Dividethisquaternion byband store the result indest.The division expressed using the inverse is performed in the following way:
dest = this * b^-1, whereb^-1is the inverse ofb.- Parameters:
 b- theQuaternionfcto divide this bydest- will hold the result- Returns:
 - dest
 
 - 
conjugate
Conjugate this quaternion and store the result indest.- Parameters:
 dest- will hold the result- Returns:
 - dest
 
 - 
rotateXYZ
Apply a rotation tothisquaternion rotating the given radians about the cartesian base unit axes, called the euler angles using rotation sequenceXYZand store the result indest.This method is equivalent to calling:
rotateX(angleX, dest).rotateY(angleY).rotateZ(angleZ)If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 angleX- the angle in radians to rotate about the x axisangleY- the angle in radians to rotate about the y axisangleZ- the angle in radians to rotate about the z axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateZYX
Apply a rotation tothisquaternion rotating the given radians about the cartesian base unit axes, called the euler angles, using the rotation sequenceZYXand store the result indest.This method is equivalent to calling:
rotateZ(angleZ, dest).rotateY(angleY).rotateX(angleX)If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 angleZ- the angle in radians to rotate about the z axisangleY- the angle in radians to rotate about the y axisangleX- the angle in radians to rotate about the x axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateYXZ
Apply a rotation tothisquaternion rotating the given radians about the cartesian base unit axes, called the euler angles, using the rotation sequenceYXZand store the result indest.This method is equivalent to calling:
rotateY(angleY, dest).rotateX(angleX).rotateZ(angleZ)If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 angleY- the angle in radians to rotate about the y axisangleX- the angle in radians to rotate about the x axisangleZ- the angle in radians to rotate about the z axisdest- will hold the result- Returns:
 - dest
 
 - 
getEulerAnglesXYZ
Get the euler angles in radians in rotation sequenceXYZof this quaternion and store them in the provided parametereulerAngles.The Euler angles are always returned as the angle around X in the
Vector3f.xfield, the angle around Y in theVector3f.yfield and the angle around Z in theVector3f.zfield of the suppliedVector3finstance.- Parameters:
 eulerAngles- will hold the euler angles in radians- Returns:
 - the passed in vector
 
 - 
getEulerAnglesZYX
Get the euler angles in radians in rotation sequenceZYXof this quaternion and store them in the provided parametereulerAngles.The Euler angles are always returned as the angle around X in the
Vector3f.xfield, the angle around Y in theVector3f.yfield and the angle around Z in theVector3f.zfield of the suppliedVector3finstance.- Parameters:
 eulerAngles- will hold the euler angles in radians- Returns:
 - the passed in vector
 
 - 
getEulerAnglesZXY
Get the euler angles in radians in rotation sequenceZXYof this quaternion and store them in the provided parametereulerAngles.The Euler angles are always returned as the angle around X in the
Vector3f.xfield, the angle around Y in theVector3f.yfield and the angle around Z in theVector3f.zfield of the suppliedVector3finstance.- Parameters:
 eulerAngles- will hold the euler angles in radians- Returns:
 - the passed in vector
 
 - 
getEulerAnglesYXZ
Get the euler angles in radians in rotation sequenceYXZof this quaternion and store them in the provided parametereulerAngles.The Euler angles are always returned as the angle around X in the
Vector3f.xfield, the angle around Y in theVector3f.yfield and the angle around Z in theVector3f.zfield of the suppliedVector3finstance.- Parameters:
 eulerAngles- will hold the euler angles in radians- Returns:
 - the passed in vector
 
 - 
lengthSquared
float lengthSquared()Return the square of the length of this quaternion.- Returns:
 - the length
 
 - 
slerp
Interpolate betweenthisunitquaternion and the specifiedtargetunitquaternion using spherical linear interpolation using the specified interpolation factoralpha, and store the result indest.This method resorts to non-spherical linear interpolation when the absolute dot product of
thisandtargetis below1E-6f.Reference: http://fabiensanglard.net
- Parameters:
 target- the target of the interpolation, which should be reached withalpha = 1.0alpha- the interpolation factor, within[0..1]dest- will hold the result- Returns:
 - dest
 
 - 
scale
Apply scaling to this quaternion, which results in any vector transformed by the quaternion to change its length by the givenfactor, and store the result indest.- Parameters:
 factor- the scaling factordest- will hold the result- Returns:
 - dest
 
 - 
integrate
Integrate the rotation given by the angular velocity(vx, vy, vz)around the x, y and z axis, respectively, with respect to the given elapsed time deltadtand add the differentiate rotation to the rotation represented by this quaternion and store the result intodest.This method pre-multiplies the rotation given by
dtand(vx, vy, vz)bythis, so the angular velocities are always relative to the local coordinate system of the rotation represented bythisquaternion.This method is equivalent to calling:
rotateLocal(dt * vx, dt * vy, dt * vz, dest)Reference: http://physicsforgames.blogspot.de/
- Parameters:
 dt- the delta timevx- the angular velocity around the x axisvy- the angular velocity around the y axisvz- the angular velocity around the z axisdest- will hold the result- Returns:
 - dest
 
 - 
nlerp
Compute a linear (non-spherical) interpolation ofthisand the given quaternionqand store the result indest.Reference: http://fabiensanglard.net
- Parameters:
 q- the other quaternionfactor- the interpolation factor. It is between 0.0 and 1.0dest- will hold the result- Returns:
 - dest
 
 - 
nlerpIterative
Compute linear (non-spherical) interpolations ofthisand the given quaternionqiteratively and store the result indest.This method performs a series of small-step nlerp interpolations to avoid doing a costly spherical linear interpolation, like
slerp, by subdividing the rotation arc betweenthisandqvia non-spherical linear interpolations as long as the absolute dot product ofthisandqis greater than the givendotThresholdparameter.Thanks to
@theagentdat http://www.java-gaming.org/ for providing the code.- Parameters:
 q- the other quaternionalpha- the interpolation factor, between 0.0 and 1.0dotThreshold- the threshold for the dot product ofthisandqabove which this method performs another iteration of a small-step linear interpolationdest- will hold the result- Returns:
 - dest
 
 - 
lookAlong
Apply a rotation to this quaternion that maps the given direction to the positive Z axis, and store the result indest.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
upanddirvectors.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!Reference: http://answers.unity3d.com
- Parameters:
 dir- the direction to map to the positive Z axisup- the vector which will be mapped to a vector parallel to the plane spanned by the givendirandupdest- will hold the result- Returns:
 - dest
 - See Also:
 
 - 
lookAlong
Quaternionf lookAlong(float dirX, float dirY, float dirZ, float upX, float upY, float upZ, Quaternionf dest) Apply a rotation to this quaternion that maps the given direction to the positive Z axis, and store the result indest.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
upanddirvectors.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!Reference: http://answers.unity3d.com
- Parameters:
 dirX- the x-coordinate of the direction to look alongdirY- the y-coordinate of the direction to look alongdirZ- the z-coordinate of the direction to look alongupX- the x-coordinate of the up vectorupY- the y-coordinate of the up vectorupZ- the z-coordinate of the up vectordest- will hold the result- Returns:
 - dest
 
 - 
rotateTo
Quaternionf rotateTo(float fromDirX, float fromDirY, float fromDirZ, float toDirX, float toDirY, float toDirZ, Quaternionf dest) Apply a rotation tothisthat rotates thefromDirvector to point alongtoDirand store the result indest.Since there can be multiple possible rotations, this method chooses the one with the shortest arc.
If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!Reference: stackoverflow.com
- Parameters:
 fromDirX- the x-coordinate of the direction to rotate into the destination directionfromDirY- the y-coordinate of the direction to rotate into the destination directionfromDirZ- the z-coordinate of the direction to rotate into the destination directiontoDirX- the x-coordinate of the direction to rotate totoDirY- the y-coordinate of the direction to rotate totoDirZ- the z-coordinate of the direction to rotate todest- will hold the result- Returns:
 - dest
 
 - 
rotateTo
Apply a rotation tothisthat rotates thefromDirvector to point alongtoDirand store the result indest.Because there can be multiple possible rotations, this method chooses the one with the shortest arc.
If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 fromDir- the starting directiontoDir- the destination directiondest- will hold the result- Returns:
 - dest
 - See Also:
 
 - 
rotateX
Apply a rotation tothisquaternion rotating the given radians about the x axis and store the result indest.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 angle- the angle in radians to rotate about the x axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateY
Apply a rotation tothisquaternion rotating the given radians about the y axis and store the result indest.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 angle- the angle in radians to rotate about the y axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateZ
Apply a rotation tothisquaternion rotating the given radians about the z axis and store the result indest.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 angle- the angle in radians to rotate about the z axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateLocalX
Apply a rotation tothisquaternion rotating the given radians about the local x axis and store the result indest.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beR * Q. So when transforming a vectorvwith the new quaternion by usingR * Q * v, the rotation represented bythiswill be applied first!- Parameters:
 angle- the angle in radians to rotate about the local x axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateLocalY
Apply a rotation tothisquaternion rotating the given radians about the local y axis and store the result indest.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beR * Q. So when transforming a vectorvwith the new quaternion by usingR * Q * v, the rotation represented bythiswill be applied first!- Parameters:
 angle- the angle in radians to rotate about the local y axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateLocalZ
Apply a rotation tothisquaternion rotating the given radians about the local z axis and store the result indest.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beR * Q. So when transforming a vectorvwith the new quaternion by usingR * Q * v, the rotation represented bythiswill be applied first!- Parameters:
 angle- the angle in radians to rotate about the local z axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateAxis
Apply a rotation tothisquaternion rotating the given radians about the specified axis and store the result indest.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 angle- the angle in radians to rotate about the specified axisaxisX- the x coordinate of the rotation axisaxisY- the y coordinate of the rotation axisaxisZ- the z coordinate of the rotation axisdest- will hold the result- Returns:
 - dest
 
 - 
rotateAxis
Apply a rotation tothisquaternion rotating the given radians about the specified axis and store the result indest.If
Qisthisquaternion andRthe quaternion representing the specified rotation, then the new quaternion will beQ * R. So when transforming a vectorvwith the new quaternion by usingQ * R * v, the rotation added by this method will be applied first!- Parameters:
 angle- the angle in radians to rotate about the specified axisaxis- the rotation axisdest- will hold the result- Returns:
 - dest
 - See Also:
 
 - 
difference
Compute the difference betweenthisand theotherquaternion and store the result indest.The difference is the rotation that has to be applied to get from
thisrotation toother. IfTisthis,QisotherandDis the computed difference, then the following equation holds:T * D = QIt is defined as:
D = T^-1 * Q, whereT^-1denotes theinverseofT.- Parameters:
 other- the other quaterniondest- will hold the result- Returns:
 - dest
 
 - 
positiveX
Obtain the direction of+Xbefore the rotation transformation represented bythisquaternion is applied.This method is equivalent to the following code:
Quaternionf inv = new Quaternionf(this).invert(); inv.transform(dir.set(1, 0, 0));
- Parameters:
 dir- will hold the direction of+X- Returns:
 - dir
 
 - 
normalizedPositiveX
Obtain the direction of+Xbefore the rotation transformation represented bythisnormalized quaternion is applied. The quaternion must benormalizedfor this method to work.This method is equivalent to the following code:
Quaternionf inv = new Quaternionf(this).conjugate(); inv.transform(dir.set(1, 0, 0));
- Parameters:
 dir- will hold the direction of+X- Returns:
 - dir
 
 - 
positiveY
Obtain the direction of+Ybefore the rotation transformation represented bythisquaternion is applied.This method is equivalent to the following code:
Quaternionf inv = new Quaternionf(this).invert(); inv.transform(dir.set(0, 1, 0));
- Parameters:
 dir- will hold the direction of+Y- Returns:
 - dir
 
 - 
normalizedPositiveY
Obtain the direction of+Ybefore the rotation transformation represented bythisnormalized quaternion is applied. The quaternion must benormalizedfor this method to work.This method is equivalent to the following code:
Quaternionf inv = new Quaternionf(this).conjugate(); inv.transform(dir.set(0, 1, 0));
- Parameters:
 dir- will hold the direction of+Y- Returns:
 - dir
 
 - 
positiveZ
Obtain the direction of+Zbefore the rotation transformation represented bythisquaternion is applied.This method is equivalent to the following code:
Quaternionf inv = new Quaternionf(this).invert(); inv.transform(dir.set(0, 0, 1));
- Parameters:
 dir- will hold the direction of+Z- Returns:
 - dir
 
 - 
normalizedPositiveZ
Obtain the direction of+Zbefore the rotation transformation represented bythisnormalized quaternion is applied. The quaternion must benormalizedfor this method to work.This method is equivalent to the following code:
Quaternionf inv = new Quaternionf(this).conjugate(); inv.transform(dir.set(0, 0, 1));
- Parameters:
 dir- will hold the direction of+Z- Returns:
 - dir
 
 - 
conjugateBy
Conjugatethisby the given quaternionqby computingq * this * q^-1and store the result intodest.- Parameters:
 q- theQuaternionfcto conjugatethisbydest- will hold the result- Returns:
 - dest
 
 - 
isFinite
boolean isFinite()Determine whether all components are finite floating-point values, that is, they are notNaNand notinfinity.- Returns:
 trueif all components are finite floating-point values;falseotherwise
 - 
equals
Compare the quaternion components ofthisquaternion with the given quaternion using the givendeltaand return whether all of them are equal within a maximum difference ofdelta.Please note that this method is not used by any data structure such as
ArrayListHashSetorHashMapand their operations, such asArrayList.contains(Object)orHashSet.remove(Object), since those data structures only use theObject.equals(Object)andObject.hashCode()methods.- Parameters:
 q- the other quaterniondelta- the allowed maximum difference- Returns:
 truewhether all of the quaternion components are equal;falseotherwise
 - 
equals
boolean equals(float x, float y, float z, float w) - Parameters:
 x- the x component to compare toy- the y component to compare toz- the z component to compare tow- the w component to compare to- Returns:
 trueif all the quaternion components are equal
 
 -