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.float
getW()
Return the real (W) component in single precision.float
getX()
Return the first imaginary (X) component in single precision.float
getY()
Return the 2nd imaginary (Y) component in single precision.float
getZ()
Return the 3rd imaginary (Z) component in single precision.boolean
isFinite()
Test whether the quaternion contains infinities or NaNs.boolean
Test whether the quaternion is normalized to within a tolerance of 10^-5.boolean
isNormalized
(float tolerance) Test whether the quaternion is normalized to within the specified tolerance.boolean
Test whether the quaternion represents an identity rotation.boolean
isZero()
Test whether the quaternion is zero.float
length()
Return the length.float
lengthSq()
Return the squared length.Generate a normalized quaternion that represents the same rotation.void
put
(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
-
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:
false
if 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:
true
if 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:
true
if normalized, otherwisefalse
-
isRotationIdentity
boolean isRotationIdentity()Test whether the quaternion represents an identity rotation. The quaternion is unaffected.- Returns:
true
if 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:
true
if 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
-