Top Description Fields Constructors Methods
javax.vecmath

public Class Quat4f

extends Tuple4f
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.lang.Math

A 4 element unit quaternion represented by single precision floating point x,y,z,w coordinates. The quaternion is always normalized.

Field Summary

Modifier and TypeField and Description
pack-priv static final double
pack-priv static final double
pack-priv static final double
pack-priv static final long
Inherited from javax.vecmath.Tuple4f:
wxyz

Constructor Summary

AccessConstructor and Description
public
Quat4f(float
the x coordinate
x
,
float
the y coordinate
y
,
float
the z coordinate
z
,
float
the w scalar component
w
)

Constructs and initializes a Quat4f from the specified xyzw coordinates.

public
Quat4f(float[]
the array of length 4 containing xyzw in order
q
)

Constructs and initializes a Quat4f from the array of length 4.

public
Quat4f(Quat4f
the Quat4f containing the initialization x y z w data
q1
)

Constructs and initializes a Quat4f from the specified Quat4f.

public
Quat4f(Quat4d
the Quat4d containing the initialization x y z w data
q1
)

Constructs and initializes a Quat4f from the specified Quat4d.

public
Quat4f(Tuple4f
the Tuple4f containing the initialization x y z w data
t1
)

Constructs and initializes a Quat4f from the specified Tuple4f.

public
Quat4f(Tuple4d
the Tuple4d containing the initialization x y z w data
t1
)

Constructs and initializes a Quat4f from the specified Tuple4d.

public
Quat4f()

Constructs and initializes a Quat4f to (0.0,0.0,0.0,0.0).

Method Summary

Modifier and TypeMethod and Description
public final void
conjugate(Quat4f
the source vector
q1
)

Sets the value of this quaternion to the conjugate of quaternion q1.

public final void
conjugate()

Sets the value of this quaternion to the conjugate of itself.

public final void
interpolate(Quat4f
the other quaternion
q1
,
float
the alpha interpolation parameter
alpha
)

Performs a great circle interpolation between this quaternion and the quaternion parameter and places the result into this quaternion.

public final void
interpolate(Quat4f
the first quaternion
q1
,
Quat4f
the second quaternion
q2
,
float
the alpha interpolation parameter
alpha
)

Performs a great circle interpolation between quaternion q1 and quaternion q2 and places the result into this quaternion.

public final void
inverse(Quat4f
the quaternion to be inverted
q1
)

Sets the value of this quaternion to quaternion inverse of quaternion q1.

public final void
inverse()

Sets the value of this quaternion to the quaternion inverse of itself.

public final void
mul(Quat4f
the first quaternion
q1
,
Quat4f
the second quaternion
q2
)

Sets the value of this quaternion to the quaternion product of quaternions q1 and q2 (this = q1 * q2).

public final void
mul(Quat4f
the other quaternion
q1
)

Sets the value of this quaternion to the quaternion product of itself and q1 (this = this * q1).

public final void
mulInverse(Quat4f
the first quaternion
q1
,
Quat4f
the second quaternion
q2
)

Multiplies quaternion q1 by the inverse of quaternion q2 and places the value into this quaternion.

public final void
mulInverse(Quat4f
the other quaternion
q1
)

Multiplies this quaternion by the inverse of quaternion q1 and places the value into this quaternion.

public final void
normalize(Quat4f
the quaternion to be normalized.
q1
)

Sets the value of this quaternion to the normalized value of quaternion q1.

public final void
normalize()

Normalizes the value of this quaternion in place.

public final void
set(Matrix4f
the Matrix4f
m1
)

Sets the value of this quaternion to the rotational component of the passed matrix.

public final void
set(Matrix4d
the Matrix4d
m1
)

Sets the value of this quaternion to the rotational component of the passed matrix.

public final void
set(Matrix3f
the Matrix3f
m1
)

Sets the value of this quaternion to the rotational component of the passed matrix.

public final void
set(Matrix3d
the Matrix3d
m1
)

Sets the value of this quaternion to the rotational component of the passed matrix.

public final void
set(AxisAngle4f
the AxisAngle to be emulated
a
)

Sets the value of this quaternion to the equivalent rotation of the AxisAngle argument.

public final void
set(AxisAngle4d
the AxisAngle to be emulated
a
)

Sets the value of this quaternion to the equivalent rotation of the AxisAngle argument.

Inherited from javax.vecmath.Tuple4f:
absoluteabsoluteaddaddclampclampclampMaxclampMaxclampMinclampMincloneepsilonEqualsequalsequalsgetgetgetWgetXgetYgetZhashCodeinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddsetsetsetsetsetWsetXsetYsetZsubsubtoString

Field Detail

EPSback to summary
pack-priv static final double EPS
EPS2back to summary
pack-priv static final double EPS2
PIO2back to summary
pack-priv static final double PIO2
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple4f.serialVersionUID.

Constructor Detail

Quat4fback to summary
public Quat4f(float x, float y, float z, float w)

Constructs and initializes a Quat4f from the specified xyzw coordinates.

Parameters
x:float

the x coordinate

y:float

the y coordinate

z:float

the z coordinate

w:float

the w scalar component

Quat4fback to summary
public Quat4f(float[] q)

Constructs and initializes a Quat4f from the array of length 4.

Parameters
q:float[]

the array of length 4 containing xyzw in order

Quat4fback to summary
public Quat4f(Quat4f q1)

Constructs and initializes a Quat4f from the specified Quat4f.

Parameters
q1:Quat4f

the Quat4f containing the initialization x y z w data

Quat4fback to summary
public Quat4f(Quat4d q1)

Constructs and initializes a Quat4f from the specified Quat4d.

Parameters
q1:Quat4d

the Quat4d containing the initialization x y z w data

Quat4fback to summary
public Quat4f(Tuple4f t1)

Constructs and initializes a Quat4f from the specified Tuple4f.

Parameters
t1:Tuple4f

the Tuple4f containing the initialization x y z w data

Quat4fback to summary
public Quat4f(Tuple4d t1)

Constructs and initializes a Quat4f from the specified Tuple4d.

Parameters
t1:Tuple4d

the Tuple4d containing the initialization x y z w data

Quat4fback to summary
public Quat4f()

Constructs and initializes a Quat4f to (0.0,0.0,0.0,0.0).

Method Detail

conjugateback to summary
public final void conjugate(Quat4f q1)

Sets the value of this quaternion to the conjugate of quaternion q1.

Parameters
q1:Quat4f

the source vector

conjugateback to summary
public final void conjugate()

Sets the value of this quaternion to the conjugate of itself.

interpolateback to summary
public final void interpolate(Quat4f q1, float alpha)

Performs a great circle interpolation between this quaternion and the quaternion parameter and places the result into this quaternion.

Parameters
q1:Quat4f

the other quaternion

alpha:float

the alpha interpolation parameter

interpolateback to summary
public final void interpolate(Quat4f q1, Quat4f q2, float alpha)

Performs a great circle interpolation between quaternion q1 and quaternion q2 and places the result into this quaternion.

Parameters
q1:Quat4f

the first quaternion

q2:Quat4f

the second quaternion

alpha:float

the alpha interpolation parameter

inverseback to summary
public final void inverse(Quat4f q1)

Sets the value of this quaternion to quaternion inverse of quaternion q1.

Parameters
q1:Quat4f

the quaternion to be inverted

inverseback to summary
public final void inverse()

Sets the value of this quaternion to the quaternion inverse of itself.

mulback to summary
public final void mul(Quat4f q1, Quat4f q2)

Sets the value of this quaternion to the quaternion product of quaternions q1 and q2 (this = q1 * q2). Note that this is safe for aliasing (e.g. this can be q1 or q2).

Parameters
q1:Quat4f

the first quaternion

q2:Quat4f

the second quaternion

mulback to summary
public final void mul(Quat4f q1)

Sets the value of this quaternion to the quaternion product of itself and q1 (this = this * q1).

Parameters
q1:Quat4f

the other quaternion

mulInverseback to summary
public final void mulInverse(Quat4f q1, Quat4f q2)

Multiplies quaternion q1 by the inverse of quaternion q2 and places the value into this quaternion. The value of both argument quaternions is preservered (this = q1 * q2^-1).

Parameters
q1:Quat4f

the first quaternion

q2:Quat4f

the second quaternion

mulInverseback to summary
public final void mulInverse(Quat4f q1)

Multiplies this quaternion by the inverse of quaternion q1 and places the value into this quaternion. The value of the argument quaternion is preserved (this = this * q^-1).

Parameters
q1:Quat4f

the other quaternion

normalizeback to summary
public final void normalize(Quat4f q1)

Sets the value of this quaternion to the normalized value of quaternion q1.

Parameters
q1:Quat4f

the quaternion to be normalized.

normalizeback to summary
public final void normalize()

Normalizes the value of this quaternion in place.

setback to summary
public final void set(Matrix4f m1)

Sets the value of this quaternion to the rotational component of the passed matrix.

Parameters
m1:Matrix4f

the Matrix4f

setback to summary
public final void set(Matrix4d m1)

Sets the value of this quaternion to the rotational component of the passed matrix.

Parameters
m1:Matrix4d

the Matrix4d

setback to summary
public final void set(Matrix3f m1)

Sets the value of this quaternion to the rotational component of the passed matrix.

Parameters
m1:Matrix3f

the Matrix3f

setback to summary
public final void set(Matrix3d m1)

Sets the value of this quaternion to the rotational component of the passed matrix.

Parameters
m1:Matrix3d

the Matrix3d

setback to summary
public final void set(AxisAngle4f a)

Sets the value of this quaternion to the equivalent rotation of the AxisAngle argument.

Parameters
a:AxisAngle4f

the AxisAngle to be emulated

setback to summary
public final void set(AxisAngle4d a)

Sets the value of this quaternion to the equivalent rotation of the AxisAngle argument.

Parameters
a:AxisAngle4d

the AxisAngle to be emulated