java.lang.Object
javax.vecmath.Tuple4d
javax.vecmath.Quat4d
- All Implemented Interfaces:
Serializable
,Cloneable
A 4 element quaternion represented by double precision floating
point x,y,z,w coordinates.
- Version:
- specification 1.1, implementation $Revision: 1.8 $, $Date: 1999/10/05 07:03:50 $
- Author:
- Kenji hiranabe
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionQuat4d()
Constructs and initializes a Quat4d to (0,0,0,0).Quat4d
(double[] q) Constructs and initializes a Quat4d from the array of length 4.Quat4d
(double x, double y, double z, double w) Constructs and initializes a Quat4d from the specified xyzw coordinates.Constructs and initializes a Quat4d from the specified Quat4d.Constructs and initializes a Quat4d from the specified Quat4f.Constructs and initializes a Quat4d from the specified Tuple4d.Constructs and initializes a Quat4d from the specified Tuple4f. -
Method Summary
Modifier and TypeMethodDescriptionclone()
final void
Negate the value of of each of this quaternion's x,y,z coordinates in place.final void
Sets the value of this quaternion to the conjugate of quaternion q1.final void
interpolate
(Quat4d q1, double alpha) Performs a great circle interpolation between this quaternion and the quaternion parameter and places the result into this quaternion.final void
interpolate
(Quat4d q1, Quat4d q2, double alpha) Performs a great circle interpolation between quaternion q1 and quaternion q2 and places the result into this quaternion.final void
inverse()
Sets the value of this quaternion to the quaternion inverse of itself.final void
Sets the value of this quaternion to quaternion inverse of quaternion q1.final void
Sets the value of this quaternion to the quaternion product of itself and q1 (this = this * q1).final void
Sets the value of this quaternion to the quaternion product of quaternions q1 and q2 (this = q1 * q2).final void
mulInverse
(Quat4d q1) Multiplies this quaternion by the inverse of quaternion q1 and places the value into this quaternion.final void
mulInverse
(Quat4d q1, Quat4d q2) Multiplies quaternion q1 by the inverse of quaternion q2 and places the value into this quaternion.final void
Normalizes the value of this quaternion in place.final void
Sets the value of this quaternion to the normalized value of quaternion q1.final void
set
(AxisAngle4d a1) Sets the value of this quaternion to the equivalent rotation of teh AxisAngle argument.final void
set
(AxisAngle4f a1) Sets the value of this quaternion to the equivalent rotation of teh AxisAngle argument.final void
Sets the value of this quaternion to the rotational component of the passed matrix.final void
Sets the value of this quaternion to the rotational component of the passed matrix.final void
Sets the value of this quaternion to the rotational component of the passed matrix.final void
Sets the value of this quaternion to the rotational component of the passed matrix.Methods inherited from class javax.vecmath.Tuple4d
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, epsilonEquals, equals, equals, get, get, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toString
-
Constructor Details
-
Quat4d
public Quat4d(double x, double y, double z, double w) Constructs and initializes a Quat4d from the specified xyzw coordinates.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinatew
- the w scalar component
-
Quat4d
public Quat4d(double[] q) Constructs and initializes a Quat4d from the array of length 4.- Parameters:
v
- the array of length 4 containing xyzw in order
-
Quat4d
Constructs and initializes a Quat4d from the specified Quat4d.- Parameters:
q1
- the Quat4d containing the initialization x y z w data
-
Quat4d
Constructs and initializes a Quat4d from the specified Quat4f.- Parameters:
q1
- the Quat4f containing the initialization x y z w data
-
Quat4d
Constructs and initializes a Quat4d from the specified Tuple4d.- Parameters:
t1
- the Tuple4d containing the initialization x y z w data
-
Quat4d
Constructs and initializes a Quat4d from the specified Tuple4f.- Parameters:
t1
- the Tuple4f containing the initialization x y z w data
-
Quat4d
public Quat4d()Constructs and initializes a Quat4d to (0,0,0,0).
-
-
Method Details
-
conjugate
Sets the value of this quaternion to the conjugate of quaternion q1.- Parameters:
q1
- the source vector
-
conjugate
public final void conjugate()Negate the value of of each of this quaternion's x,y,z coordinates in place. -
mul
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
- the first quaternionq2
- the second quaternion
-
mul
Sets the value of this quaternion to the quaternion product of itself and q1 (this = this * q1).- Parameters:
q1
- the other quaternion
-
mulInverse
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
- the left quaternionq2
- the right quaternion
-
mulInverse
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
- the other quaternion
-
inverse
Sets the value of this quaternion to quaternion inverse of quaternion q1.- Parameters:
q1
- the quaternion to be inverted
-
inverse
public final void inverse()Sets the value of this quaternion to the quaternion inverse of itself. -
normalize
Sets the value of this quaternion to the normalized value of quaternion q1.- Parameters:
q1
- the quaternion to be normalized.
-
normalize
public final void normalize()Normalizes the value of this quaternion in place. -
set
Sets the value of this quaternion to the rotational component of the passed matrix.- Parameters:
m1
- the matrix4f
-
set
Sets the value of this quaternion to the rotational component of the passed matrix.- Parameters:
m1
- the matrix4d
-
set
Sets the value of this quaternion to the rotational component of the passed matrix.- Parameters:
m1
- the matrix3f
-
set
Sets the value of this quaternion to the rotational component of the passed matrix.- Parameters:
m1
- the matrix3d
-
set
Sets the value of this quaternion to the equivalent rotation of teh AxisAngle argument.- Parameters:
a1
- the axis-angle
-
set
Sets the value of this quaternion to the equivalent rotation of teh AxisAngle argument.- Parameters:
a1
- the axis-angle
-
interpolate
Performs a great circle interpolation between this quaternion and the quaternion parameter and places the result into this quaternion.- Parameters:
q1
- the other quaternionalpha
- the alpha interpolation parameter
-
interpolate
Performs a great circle interpolation between quaternion q1 and quaternion q2 and places the result into this quaternion.- Parameters:
q1
- the first quaternionq2
- the second quaternionalpha
- the alpha interpolation parameter
-
clone
-