Interface QuatArg
- All Known Implementing Classes:
Quat
public interface QuatArg
Read-only access to a
Quat. (native type: const Quat)-
Method Summary
Modifier and TypeMethodDescriptionReturn the conjugate.voidcopyTo(FloatBuffer storeFloats) Write all 4 components to the start of the specified buffer.floatgetW()Return the real (W) component in single precision.floatgetX()Return the first imaginary (X) component in single precision.floatgetY()Return the 2nd imaginary (Y) component in single precision.floatgetZ()Return the 3rd imaginary (Z) component in single precision.booleanisFinite()Test whether the quaternion contains infinities or NaNs.booleanTest whether the quaternion is normalized to within a tolerance of 10^-5.booleanisNormalized(float tolerance) Test whether the quaternion is normalized to within the specified tolerance.booleanTest whether the quaternion represents an identity rotation.booleanisZero()Test whether the quaternion is zero.floatlength()Return the length.floatlengthSq()Return the squared length.Generate a normalized quaternion that represents the same rotation.voidput(FloatBuffer storeBuffer) Write all 4 components to the specified buffer and advance the buffer's position by 4.Apply the rotation to (1,0,0).Apply the rotation to (0,1,0).Apply the rotation to (0,0,1).
-
Method Details
-
copyTo
Write all 4 components to the start of the specified buffer. The current object is unaffected.- Parameters:
storeFloats- the destination buffer (not null, capacity≥4)
-
conjugated
Quat conjugated()Return the conjugate. The current object is unaffected.- Returns:
- a new object
-
getW
float getW()Return the real (W) component in single precision. The quaternion is unaffected.- Returns:
- the component value
-
getX
float getX()Return the first imaginary (X) component in single precision. The quaternion is unaffected.- Returns:
- the component value
-
getY
float getY()Return the 2nd imaginary (Y) component in single precision. The quaternion is unaffected.- Returns:
- the component value
-
getZ
float getZ()Return the 3rd imaginary (Z) component in single precision. The quaternion is unaffected.- Returns:
- the component value
-
isFinite
boolean isFinite()Test whether the quaternion contains infinities or NaNs. The quaternion is unaffected.- Returns:
falseif one or more infinities or NaNs, otherwisetrue
-
isNormalized
boolean isNormalized()Test whether the quaternion is normalized to within a tolerance of 10^-5. The quaternion is unaffected.- Returns:
trueif normalized, otherwisefalse
-
isNormalized
boolean isNormalized(float tolerance) Test whether the quaternion is normalized to within the specified tolerance. The quaternion is unaffected.- Parameters:
tolerance- the desired tolerance (default=1e-5)- Returns:
trueif normalized, otherwisefalse
-
isRotationIdentity
boolean isRotationIdentity()Test whether the quaternion represents an identity rotation. The quaternion is unaffected.- Returns:
trueif the real component is a non-zero number and the imaginary components are all zero, otherwisefalse
-
isZero
boolean isZero()Test whether the quaternion is zero. The quaternion is unaffected.- Returns:
trueif exactly zero, otherwisefalse
-
length
float length()Return the length. The quaternion is unaffected.- Returns:
- the length
-
lengthSq
float lengthSq()Return the squared length. The quaternion is unaffected.- Returns:
- the squared length
-
normalized
Quat normalized()Generate a normalized quaternion that represents the same rotation. The current object is unaffected.- Returns:
- a new quaternion
-
put
Write all 4 components to the specified buffer and advance the buffer's position by 4. The quaternion is unaffected.- Parameters:
storeBuffer- the destination buffer (not null)
-
rotateAxisX
Vec3 rotateAxisX()Apply the rotation to (1,0,0). The quaternion is assumed to be normalized and is unaffected.- Returns:
- a new vector
-
rotateAxisY
Vec3 rotateAxisY()Apply the rotation to (0,1,0). The quaternion is assumed to be normalized and is unaffected.- Returns:
- a new vector
-
rotateAxisZ
Vec3 rotateAxisZ()Apply the rotation to (0,0,1). The quaternion is assumed to be normalized and is unaffected.- Returns:
- a new vector
-