public interface Quaternion extends CloneableSerializable, Vectorizable
Modifier and Type | Method and Description |
---|---|
Quaternion |
clone()
Clones this object.
|
Quaternion |
compose(Quaternion other)
Multiplies
this * other and returns the result. |
void |
composeEquals(Quaternion other)
Multiplies
this = this * other , thus modifying this object. |
void |
convertFromRotationMatrix(Matrix rotationMatrix)
Sets the quaternion to be equivalent to the given a 3-by-3 rotation
matrix.
|
Matrix |
convertToRotationMatrix()
Converts the quaternion to a 3-by-3 rotation matrix.
|
boolean |
equals(Quaternion other)
Determines if this quaternion is equal to the given quaternion.
|
boolean |
equals(Quaternion other,
double effectiveZero)
Determines if this quaternion is equal to the given quaternion, using
a given threshold for determining if two numbers are equal.
|
double |
getW()
Gets the w component of the quaternion.
|
double |
getX()
Gets the x component of the quaternion.
|
double |
getY()
Gets the y component of the quaternion.
|
double |
getZ()
Gets the z component of the quaternion.
|
Quaternion |
interpolate(Quaternion other,
double alpha)
Interpolates between this quaternion and the given quaternion.
|
void |
interpolateEquals(Quaternion other,
double alpha)
Interpolates between this quaternion and the given quaternion and sets
it in this quaternion.
|
Quaternion |
inverse()
Returns the inverse of this quaternion.
|
void |
inverseEquals()
Changes this quaternion to be its inverse.
|
Quaternion |
normalize()
Returns the normalized version of the quaternion.
|
void |
normalizeEquals()
Normalizes the quaternion in-place.
|
Vector3 |
rotate(Vector vector)
Rotates the given vector by this quaternion by performing a
multiplication with this quaternion's rotation matrix: M * v.
|
void |
setElements(Quaternion other)
Sets the elements of this quaternion equal to the elements of the given
quaternion.
|
void |
setW(double w)
Sets the w component of the quaternion.
|
void |
setWXYZ(double w,
double x,
double y,
double z)
Sets all of the elements of the quaternion in w-x-y-z order.
|
void |
setX(double x)
Sets the x component of the quaternion.
|
void |
setXYZW(double x,
double y,
double z,
double w)
Sets all of the elements of the quaternion in x-y-z-w order.
|
void |
setY(double y)
Sets the y component of the quaternion.
|
void |
setZ(double z)
Sets the z component of the quaternion.
|
convertFromVector, convertToVector
Quaternion clone()
clone
in interface CloneableSerializable
clone
in interface Vectorizable
void setElements(Quaternion other)
other
- The other quaternion to copy the values of.Quaternion normalize()
void normalizeEquals()
Quaternion inverse()
void inverseEquals()
Vector3 rotate(Vector vector)
vector
- The 3-dimensional vector to rotate.Quaternion compose(Quaternion other)
this * other
and returns the result.other
- The other quaternion to multiply with.void composeEquals(Quaternion other)
this = this * other
, thus modifying this object.other
- The other quaternion to multiply with.Quaternion interpolate(Quaternion other, double alpha)
other
- The other quaternion.alpha
- The interpolation parameter.void interpolateEquals(Quaternion other, double alpha)
other
- The other quaternion.alpha
- The interpolation parameter.Matrix convertToRotationMatrix()
void convertFromRotationMatrix(Matrix rotationMatrix)
rotationMatrix
- A 3-by-3 rotation matrix.boolean equals(Quaternion other)
other
- The other quaternion to determine equality with.boolean equals(Quaternion other, double effectiveZero)
other
- The other quaternion.effectiveZero
- The effective zero value for performing the
fuzzy equality. Typically, this is a number close to zero.double getW()
void setW(double w)
w
- The w component of the quaternion.double getX()
void setX(double x)
x
- The x component of the quaternion.double getY()
void setY(double y)
y
- The y component of the quaternion.double getZ()
void setZ(double z)
z
- The z component of the quaternion.void setWXYZ(double w, double x, double y, double z)
w
- The w component of the quaternion.x
- The x component of the quaternion.y
- The y component of the quaternion.z
- The z component of the quaternion.void setXYZW(double x, double y, double z, double w)
x
- The x component of the quaternion.y
- The y component of the quaternion.z
- The z component of the quaternion.w
- The w component of the quaternion.