JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.math.Quaternion Class Reference

Quaternion implementation supporting Gimbal-Lock free rotations. More...

Collaboration diagram for com.jogamp.math.Quaternion:

Public Member Functions

 Quaternion ()
 
 Quaternion (final Quaternion q)
 
 Quaternion (final float x, final float y, final float z, final float w)
 
Quaternion copy ()
 
final float magnitudeSquared ()
 See magnitude() for special handling of epsilon, which is not applied here. More...
 
final float magnitude ()
 Return the magnitude of this quaternion, i.e. More...
 
final float w ()
 
final void setW (final float w)
 
final float x ()
 
final void setX (final float x)
 
final float y ()
 
final void setY (final float y)
 
final float z ()
 
final void setZ (final float z)
 
final float dot (final float x, final float y, final float z, final float w)
 Returns the dot product of this quaternion with the given x,y,z and w components. More...
 
final float dot (final Quaternion quat)
 Returns the dot product of this quaternion with the given quaternion. More...
 
final boolean isIdentity ()
 Returns true if this quaternion has identity. More...
 
final Quaternion setIdentity ()
 
final Quaternion normalize ()
 Normalize a quaternion required if to be used as a rotational quaternion. More...
 
Quaternion conjugate ()
 Conjugates this quaternion [-x, -y, -z, w]. More...
 
final Quaternion invert ()
 Invert the quaternion If rotational, will produce a the inverse rotation. More...
 
final Quaternion set (final Quaternion src)
 Set all values of this quaternion using the given src. More...
 
final Quaternion set (final float x, final float y, final float z, final float w)
 Set all values of this quaternion using the given components. More...
 
final Quaternion add (final Quaternion q)
 Add a quaternion. More...
 
final Quaternion subtract (final Quaternion q)
 Subtract a quaternion. More...
 
final Quaternion mult (final Quaternion q)
 Multiply this quaternion by the param quaternion. More...
 
final Quaternion scale (final float n)
 Scale this quaternion by a constant. More...
 
Quaternion rotateByAngleNormalAxis (final float angle, final float axisX, final float axisY, final float axisZ)
 Rotate this quaternion by the given angle and axis. More...
 
Quaternion rotateByAngleNormalAxis (final float angle, final Vec3f axis)
 Rotate this quaternion by the given angle and axis. More...
 
Quaternion rotateByAngleX (final float angle)
 Rotate this quaternion around X axis with the given angle in radians. More...
 
Quaternion rotateByAngleY (final float angle)
 Rotate this quaternion around Y axis with the given angle in radians. More...
 
Quaternion rotateByAngleZ (final float angle)
 Rotate this quaternion around Z axis with the given angle in radians. More...
 
final Quaternion rotateByEuler (final Vec3f angradXYZ)
 Rotates this quaternion from the given Euler rotation array angradXYZ in radians. More...
 
final Quaternion rotateByEuler (final float bankX, final float headingY, final float attitudeZ)
 Rotates this quaternion from the given Euler rotation angles in radians. More...
 
final Vec3f rotateVector (final Vec3f vecIn, final Vec3f vecOut)
 
final Quaternion setSlerp (final Quaternion a, final Quaternion b, final float changeAmnt)
 Set this quaternion to a spherical linear interpolation between the given start and end quaternions by the given change amount. More...
 
Quaternion setLookAt (final Vec3f directionIn, final Vec3f upIn, final Vec3f xAxisOut, final Vec3f yAxisOut, final Vec3f zAxisOut)
 Set this quaternion to equal the rotation required to point the z-axis at direction and the y-axis to up. More...
 
final Quaternion setFromVectors (final Vec3f v1, final Vec3f v2, final Vec3f tmpPivotVec, final Vec3f tmpNormalVec)
 Initialize this quaternion from two vectors. More...
 
final Quaternion setFromNormalVectors (final Vec3f v1, final Vec3f v2, final Vec3f tmpPivotVec)
 Initialize this quaternion from two normalized vectors. More...
 
final Quaternion setFromAngleAxis (final float angle, final Vec3f vector, final Vec3f tmpV3f)
 
final Quaternion setFromAngleNormalAxis (final float angle, final Vec3f vector)
 
final float toAngleAxis (final Vec3f axis)
 Transform the rotational quaternion to axis based rotation angles. More...
 
final Quaternion setFromEuler (final Vec3f angradXYZ)
 Initializes this quaternion from the given Euler rotation array angradXYZ in radians. More...
 
final Quaternion setFromEuler (final float bankX, final float headingY, final float attitudeZ)
 Initializes this quaternion from the given Euler rotation angles in radians. More...
 
Vec3f toEuler (final Vec3f result)
 Transform this quaternion to Euler rotation angles in radians (pitchX, yawY and rollZ). More...
 
Quaternion setFromMat (final float m00, final float m01, final float m02, final float m10, final float m11, final float m12, final float m20, final float m21, final float m22)
 Compute the quaternion from a 3x3 column rotation matrix. More...
 
Quaternion setFromMat (final Matrix4f m)
 Compute the quaternion from a 3x3 column rotation matrix from Matrix4f instance. More...
 
final float[] toMatrix (final float[] matrix)
 Transform this quaternion to a normalized 4x4 column matrix representing the rotation. More...
 
final Matrix4f toMatrix (final Matrix4f matrix)
 Transform this quaternion to a normalized 4x4 column matrix representing the rotation. More...
 
final Quaternion setFromAxes (final Vec3f xAxis, final Vec3f yAxis, final Vec3f zAxis)
 Initializes this quaternion to represent a rotation formed by the given three orthogonal axes. More...
 
void toAxes (final Vec3f xAxis, final Vec3f yAxis, final Vec3f zAxis, final Matrix4f tmpMat4)
 Extracts this quaternion's orthogonal rotation axes. More...
 
final boolean isRotationMatrix3f (final float[] m)
 Check if the the 3x3 matrix (param) is in fact an affine rotational matrix. More...
 
boolean equals (final Object o)
 
final int hashCode ()
 
String toString ()
 

Static Public Attributes

static final float ALLOWED_DEVIANCE = 1.0E-6f
 Quaternion Epsilon, used with equals method to determine if two Quaternions are close enough to be considered equal. More...
 

Detailed Description

Quaternion implementation supporting Gimbal-Lock free rotations.

All matrix operation provided are in column-major order, as specified in the OpenGL fixed function pipeline, i.e. compatibility profile. See FloatUtil.

See Matrix-FAQ

See euclideanspace.com-Quaternion

Definition at line 45 of file Quaternion.java.

Constructor & Destructor Documentation

◆ Quaternion() [1/3]

com.jogamp.math.Quaternion.Quaternion ( )

Definition at line 56 of file Quaternion.java.

Here is the caller graph for this function:

◆ Quaternion() [2/3]

com.jogamp.math.Quaternion.Quaternion ( final Quaternion  q)

Definition at line 60 of file Quaternion.java.

◆ Quaternion() [3/3]

com.jogamp.math.Quaternion.Quaternion ( final float  x,
final float  y,
final float  z,
final float  w 
)

Definition at line 64 of file Quaternion.java.

Member Function Documentation

◆ add()

final Quaternion com.jogamp.math.Quaternion.add ( final Quaternion  q)

Add a quaternion.

Parameters
qquaternion
Returns
this quaternion for chaining.
See also
euclideanspace.com-QuaternionAdd

Definition at line 265 of file Quaternion.java.

Here is the caller graph for this function:

◆ conjugate()

Quaternion com.jogamp.math.Quaternion.conjugate ( )

Conjugates this quaternion [-x, -y, -z, w].

Returns
this quaternion for chaining.
See also
Matrix-FAQ Q49

Definition at line 202 of file Quaternion.java.

Here is the caller graph for this function:

◆ copy()

Quaternion com.jogamp.math.Quaternion.copy ( )

Definition at line 68 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dot() [1/2]

final float com.jogamp.math.Quaternion.dot ( final float  x,
final float  y,
final float  z,
final float  w 
)

Returns the dot product of this quaternion with the given x,y,z and w components.

Definition at line 139 of file Quaternion.java.

Here is the caller graph for this function:

◆ dot() [2/2]

final float com.jogamp.math.Quaternion.dot ( final Quaternion  quat)

Returns the dot product of this quaternion with the given quaternion.

Definition at line 146 of file Quaternion.java.

Here is the call graph for this function:

◆ equals()

boolean com.jogamp.math.Quaternion.equals ( final Object  o)
Parameters
othe object to compare for equality
Returns
true if this quaternion and the provided quaternion have roughly the same x, y, z and w values.

Definition at line 1168 of file Quaternion.java.

Here is the call graph for this function:

◆ hashCode()

final int com.jogamp.math.Quaternion.hashCode ( )

Definition at line 1182 of file Quaternion.java.

◆ invert()

final Quaternion com.jogamp.math.Quaternion.invert ( )

Invert the quaternion If rotational, will produce a the inverse rotation.

Implementation Details:

Returns
this quaternion for chaining.
See also
Matrix-FAQ Q50

Definition at line 220 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isIdentity()

final boolean com.jogamp.math.Quaternion.isIdentity ( )

Returns true if this quaternion has identity.

Implementation uses epsilon to compare W against 1f and X, Y and Z against zero.

Definition at line 159 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isRotationMatrix3f()

final boolean com.jogamp.math.Quaternion.isRotationMatrix3f ( final float[]  m)

Check if the the 3x3 matrix (param) is in fact an affine rotational matrix.

Parameters
m3x3 column matrix
Returns
true if representing a rotational matrix, false otherwise

Definition at line 1136 of file Quaternion.java.

◆ magnitude()

final float com.jogamp.math.Quaternion.magnitude ( )

Return the magnitude of this quaternion, i.e.

sqrt(magnitudeSquared())

A magnitude of zero shall equal identity, as performed by normalize().

Implementation Details:

Definition at line 93 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ magnitudeSquared()

final float com.jogamp.math.Quaternion.magnitudeSquared ( )

See magnitude() for special handling of epsilon, which is not applied here.

Returns
the squared magnitude of this quaternion.

Definition at line 75 of file Quaternion.java.

Here is the caller graph for this function:

◆ mult()

final Quaternion com.jogamp.math.Quaternion.mult ( final Quaternion  q)

Multiply this quaternion by the param quaternion.

Parameters
qa quaternion to multiply with
Returns
this quaternion for chaining.
See also
Matrix-FAQ Q53
euclideanspace.com-QuaternionMul

Definition at line 296 of file Quaternion.java.

Here is the caller graph for this function:

◆ normalize()

final Quaternion com.jogamp.math.Quaternion.normalize ( )

Normalize a quaternion required if to be used as a rotational quaternion.

Implementation Details:

Returns
this quaternion for chaining.

Definition at line 183 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateByAngleNormalAxis() [1/2]

Quaternion com.jogamp.math.Quaternion.rotateByAngleNormalAxis ( final float  angle,
final float  axisX,
final float  axisY,
final float  axisZ 
)

Rotate this quaternion by the given angle and axis.

The axis must be a normalized vector.

A rotational quaternion is made from the given angle and axis.

Parameters
anglein radians
axisXx-coord of rotation axis
axisYy-coord of rotation axis
axisZz-coord of rotation axis
Returns
this quaternion for chaining.

Definition at line 333 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateByAngleNormalAxis() [2/2]

Quaternion com.jogamp.math.Quaternion.rotateByAngleNormalAxis ( final float  angle,
final Vec3f  axis 
)

Rotate this quaternion by the given angle and axis.

The axis must be a normalized vector.

A rotational quaternion is made from the given angle and axis.

Parameters
anglein radians
axisVec3f coord of rotation axis
Returns
this quaternion for chaining.

Definition at line 363 of file Quaternion.java.

Here is the call graph for this function:

◆ rotateByAngleX()

Quaternion com.jogamp.math.Quaternion.rotateByAngleX ( final float  angle)

Rotate this quaternion around X axis with the given angle in radians.

Parameters
anglein radians
Returns
this quaternion for chaining.

Definition at line 373 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateByAngleY()

Quaternion com.jogamp.math.Quaternion.rotateByAngleY ( final float  angle)

Rotate this quaternion around Y axis with the given angle in radians.

Parameters
anglein radians
Returns
this quaternion for chaining.

Definition at line 389 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateByAngleZ()

Quaternion com.jogamp.math.Quaternion.rotateByAngleZ ( final float  angle)

Rotate this quaternion around Z axis with the given angle in radians.

Parameters
anglein radians
Returns
this quaternion for chaining.

Definition at line 405 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateByEuler() [1/2]

final Quaternion com.jogamp.math.Quaternion.rotateByEuler ( final float  bankX,
final float  headingY,
final float  attitudeZ 
)

Rotates this quaternion from the given Euler rotation angles in radians.

The rotations are applied in the given order and using chained rotation per axis:

Implementation Details:

Parameters
bankXthe Euler pitch angle in radians. (rotation about the X axis)
headingYthe Euler yaw angle in radians. (rotation about the Y axis)
attitudeZthe Euler roll angle in radians. (rotation about the Z axis)
Returns
this quaternion for chaining.
See also
rotateByAngleY(float)
rotateByAngleZ(float)
rotateByAngleX(float)
setFromEuler(float, float, float)

Definition at line 460 of file Quaternion.java.

Here is the call graph for this function:

◆ rotateByEuler() [2/2]

final Quaternion com.jogamp.math.Quaternion.rotateByEuler ( final Vec3f  angradXYZ)

Rotates this quaternion from the given Euler rotation array angradXYZ in radians.

The angradXYZ array is laid out in natural order:

  • x - bank
  • y - heading
  • z - attitude

For details see rotateByEuler(float, float, float).

Parameters
angradXYZeuler angle array in radians
Returns
this quaternion for chaining.
See also
rotateByEuler(float, float, float)

Definition at line 430 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateVector()

final Vec3f com.jogamp.math.Quaternion.rotateVector ( final Vec3f  vecIn,
final Vec3f  vecOut 
)

Definition at line 478 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale()

final Quaternion com.jogamp.math.Quaternion.scale ( final float  n)

Scale this quaternion by a constant.

Parameters
na float constant
Returns
this quaternion for chaining.
See also
euclideanspace.com-QuaternionScale

Definition at line 310 of file Quaternion.java.

Here is the caller graph for this function:

◆ set() [1/2]

final Quaternion com.jogamp.math.Quaternion.set ( final float  x,
final float  y,
final float  z,
final float  w 
)

Set all values of this quaternion using the given components.

Returns
this quaternion for chaining.

Definition at line 250 of file Quaternion.java.

◆ set() [2/2]

final Quaternion com.jogamp.math.Quaternion.set ( final Quaternion  src)

Set all values of this quaternion using the given src.

Returns
this quaternion for chaining.

Definition at line 238 of file Quaternion.java.

Here is the caller graph for this function:

◆ setFromAngleAxis()

final Quaternion com.jogamp.math.Quaternion.setFromAngleAxis ( final float  angle,
final Vec3f  vector,
final Vec3f  tmpV3f 
)

Definition at line 768 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFromAngleNormalAxis()

final Quaternion com.jogamp.math.Quaternion.setFromAngleNormalAxis ( final float  angle,
final Vec3f  vector 
)

Definition at line 788 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFromAxes()

final Quaternion com.jogamp.math.Quaternion.setFromAxes ( final Vec3f  xAxis,
final Vec3f  yAxis,
final Vec3f  zAxis 
)

Initializes this quaternion to represent a rotation formed by the given three orthogonal axes.

No validation whether the axes are orthogonal is performed.

Parameters
xAxisvector representing the orthogonal x-axis of the coordinate system.
yAxisvector representing the orthogonal y-axis of the coordinate system.
zAxisvector representing the orthogonal z-axis of the coordinate system.
Returns
this quaternion for chaining.

Definition at line 1107 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFromEuler() [1/2]

final Quaternion com.jogamp.math.Quaternion.setFromEuler ( final float  bankX,
final float  headingY,
final float  attitudeZ 
)

Initializes this quaternion from the given Euler rotation angles in radians.

The rotations are applied in the given order:

  • y - heading
  • z - attitude
  • x - bank

Implementation Details:

Parameters
bankXthe Euler pitch angle in radians. (rotation about the X axis)
headingYthe Euler yaw angle in radians. (rotation about the Y axis)
attitudeZthe Euler roll angle in radians. (rotation about the Z axis)
Returns
this quaternion for chaining.
See also
Matrix-FAQ Q60
Gems
euclideanspace.com-eulerToQuaternion
toEuler(Vec3f)

Definition at line 871 of file Quaternion.java.

Here is the call graph for this function:

◆ setFromEuler() [2/2]

final Quaternion com.jogamp.math.Quaternion.setFromEuler ( final Vec3f  angradXYZ)

Initializes this quaternion from the given Euler rotation array angradXYZ in radians.

The angradXYZ vector is laid out in natural order:

  • x - bank
  • y - heading
  • z - attitude

For details see setFromEuler(float, float, float).

Parameters
angradXYZeuler angle vector in radians holding x-bank, y-heading and z-attitude
Returns
this quaternion for chaining.
See also
setFromEuler(float, float, float)

Definition at line 840 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFromMat() [1/2]

Quaternion com.jogamp.math.Quaternion.setFromMat ( final float  m00,
final float  m01,
final float  m02,
final float  m10,
final float  m11,
final float  m12,
final float  m20,
final float  m21,
final float  m22 
)

Compute the quaternion from a 3x3 column rotation matrix.

See Graphics Gems Code,
MatrixTrace.

Buggy Matrix-FAQ Q55

Returns
this quaternion for chaining.
See also
setFromMat(Matrix4f)

Definition at line 952 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFromMat() [2/2]

Quaternion com.jogamp.math.Quaternion.setFromMat ( final Matrix4f  m)

Compute the quaternion from a 3x3 column rotation matrix from Matrix4f instance.

See Graphics Gems Code,
MatrixTrace.

Buggy Matrix-FAQ Q55

Returns
this quaternion for chaining.
See also
Matrix4f::getRotation(Quaternion)
setFromMat(float, float, float, float, float, float, float, float, float)

Definition at line 1008 of file Quaternion.java.

Here is the call graph for this function:

◆ setFromNormalVectors()

final Quaternion com.jogamp.math.Quaternion.setFromNormalVectors ( final Vec3f  v1,
final Vec3f  v2,
final Vec3f  tmpPivotVec 
)

Initialize this quaternion from two normalized vectors.

  q = (s,v) = (v1•v2 , v1 × v2),
    angle = angle(v1, v2) = v1•v2
     axis = v1 x v2

<p<blockquote>‍

Implementation Details:

Parameters
v1normalized
v2normalized
tmpPivotVectemp storage for cross product
Returns
this quaternion for chaining.

Definition at line 715 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFromVectors()

final Quaternion com.jogamp.math.Quaternion.setFromVectors ( final Vec3f  v1,
final Vec3f  v2,
final Vec3f  tmpPivotVec,
final Vec3f  tmpNormalVec 
)

Initialize this quaternion from two vectors.

  q = (s,v) = (v1•v2 , v1 × v2),
    angle = angle(v1, v2) = v1•v2
     axis = normal(v1 x v2)

<p<blockquote>‍

Implementation Details:

Parameters
v1not normalized
v2not normalized
tmpPivotVectemp storage for cross product
tmpNormalVectemp storage to normalize vector
Returns
this quaternion for chaining.

Definition at line 660 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIdentity()

final Quaternion com.jogamp.math.Quaternion.setIdentity ( )

Definition at line 168 of file Quaternion.java.

Here is the caller graph for this function:

◆ setLookAt()

Quaternion com.jogamp.math.Quaternion.setLookAt ( final Vec3f  directionIn,
final Vec3f  upIn,
final Vec3f  xAxisOut,
final Vec3f  yAxisOut,
final Vec3f  zAxisOut 
)

Set this quaternion to equal the rotation required to point the z-axis at direction and the y-axis to up.

Implementation generates a 3x3 matrix and is equal with ProjectFloat's lookAt(..).

Implementation Details:

Parameters
directionInwhere to look at
upIna vector indicating the local up direction.
xAxisOutvector storing the orthogonal x-axis of the coordinate system.
yAxisOutvector storing the orthogonal y-axis of the coordinate system.
zAxisOutvector storing the orthogonal z-axis of the coordinate system.
Returns
this quaternion for chaining.
See also
euclideanspace.com-LookUp

Definition at line 609 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSlerp()

final Quaternion com.jogamp.math.Quaternion.setSlerp ( final Quaternion  a,
final Quaternion  b,
final float  changeAmnt 
)

Set this quaternion to a spherical linear interpolation between the given start and end quaternions by the given change amount.

Note: Method does not normalize this quaternion!

Parameters
astart quaternion
bend quaternion
changeAmntfloat between 0 and 1 representing interpolation.
Returns
this quaternion for chaining.
See also
euclideanspace.com-QuaternionSlerp

Definition at line 525 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setW()

final void com.jogamp.math.Quaternion.setW ( final float  w)

Definition at line 108 of file Quaternion.java.

◆ setX()

final void com.jogamp.math.Quaternion.setX ( final float  x)

Definition at line 116 of file Quaternion.java.

◆ setY()

final void com.jogamp.math.Quaternion.setY ( final float  y)

Definition at line 124 of file Quaternion.java.

◆ setZ()

final void com.jogamp.math.Quaternion.setZ ( final float  z)

Definition at line 132 of file Quaternion.java.

◆ subtract()

final Quaternion com.jogamp.math.Quaternion.subtract ( final Quaternion  q)

Subtract a quaternion.

Parameters
qquaternion
Returns
this quaternion for chaining.
See also
euclideanspace.com-QuaternionAdd

Definition at line 280 of file Quaternion.java.

Here is the caller graph for this function:

◆ toAngleAxis()

final float com.jogamp.math.Quaternion.toAngleAxis ( final Vec3f  axis)

Transform the rotational quaternion to axis based rotation angles.

Parameters
axisstorage for computed axis
Returns
the rotation angle in radians
See also
setFromAngleAxis(float, Vec3f, Vec3f)

Definition at line 809 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toAxes()

void com.jogamp.math.Quaternion.toAxes ( final Vec3f  xAxis,
final Vec3f  yAxis,
final Vec3f  zAxis,
final Matrix4f  tmpMat4 
)

Extracts this quaternion's orthogonal rotation axes.

Parameters
xAxisvector representing the orthogonal x-axis of the coordinate system.
yAxisvector representing the orthogonal y-axis of the coordinate system.
zAxisvector representing the orthogonal z-axis of the coordinate system.
tmpMat4temporary float[4] matrix, used to transform this quaternion to a matrix.

Definition at line 1121 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toEuler()

Vec3f com.jogamp.math.Quaternion.toEuler ( final Vec3f  result)

Transform this quaternion to Euler rotation angles in radians (pitchX, yawY and rollZ).

The result array is laid out in natural order:

  • x - bank
  • y - heading
  • z - attitude
Parameters
resulteuler angle result vector for radians x-bank, y-heading and z-attitude
Returns
the Vec3f result filled with x-bank, y-heading and z-attitude
See also
euclideanspace.com-quaternionToEuler
setFromEuler(float, float, float)

Definition at line 915 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toMatrix() [1/2]

final float[] com.jogamp.math.Quaternion.toMatrix ( final float[]  matrix)

Transform this quaternion to a normalized 4x4 column matrix representing the rotation.

Implementation Details:

Parameters
matrixfloat[16] store for the resulting normalized column matrix 4x4
Returns
the given matrix store
See also
Matrix-FAQ Q54
setFromMat(Matrix4f)
setFromMat(float, float, float, float, float, float, float, float, float)

Definition at line 1027 of file Quaternion.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toMatrix() [2/2]

final Matrix4f com.jogamp.math.Quaternion.toMatrix ( final Matrix4f  matrix)

Transform this quaternion to a normalized 4x4 column matrix representing the rotation.

Implementation Details:

Parameters
matrixstore for the resulting normalized column matrix 4x4
Returns
the given matrix store
See also
Matrix-FAQ Q54
setFromMat(float, float, float, float, float, float, float, float, float)
Matrix4f::setToRotation(Quaternion)

Definition at line 1092 of file Quaternion.java.

Here is the call graph for this function:

◆ toString()

String com.jogamp.math.Quaternion.toString ( )

Definition at line 1187 of file Quaternion.java.

◆ w()

final float com.jogamp.math.Quaternion.w ( )

Definition at line 104 of file Quaternion.java.

◆ x()

final float com.jogamp.math.Quaternion.x ( )

Definition at line 112 of file Quaternion.java.

◆ y()

final float com.jogamp.math.Quaternion.y ( )

Definition at line 120 of file Quaternion.java.

◆ z()

final float com.jogamp.math.Quaternion.z ( )

Definition at line 128 of file Quaternion.java.

Member Data Documentation

◆ ALLOWED_DEVIANCE

final float com.jogamp.math.Quaternion.ALLOWED_DEVIANCE = 1.0E-6f
static

Quaternion Epsilon, used with equals method to determine if two Quaternions are close enough to be considered equal.

Using {@value}, which is ~10 times FloatUtil#EPSILON.

Definition at line 54 of file Quaternion.java.


The documentation for this class was generated from the following file: