Rotation
Represents a rotation in three-dimensional space.
This class uses an internal unit quaternion (Quat) for robust and unambiguous representation of rotations, avoiding issues like gimbal lock inherent in Euler angles for complex interpolations.
It provides constructors from various representations like Euler angles (EulerAngles), axis-angle, and quaternions. Properties allow accessing the rotation as a quaternion, axis-angle (angle in radians), or converting to Euler angles. Operations include composition, inversion, and spherical linear interpolation (Slerp).
Parameters
The initial quaternion to create the rotation from. It does not need to be a unit quaternion, as it will be normalized internally.
Constructors
Creates a Rotation from Euler angles specified in a EulerAngles object. Assumes EulerAngles angles (pitch, yaw, roll) are in degrees and correspond to a specific Euler rotation sequence (e.g., intrinsic ZYX for roll, new Y for yaw, newest X for pitch) handled by EulerAngles.toQuat().
Creates a Rotation from an angle (in radians) and an axis of rotation. The axis vector will be normalized if it's not already a unit vector by the Quat constructor.
Types
Properties
Gets the euler angle representation of this rotation as a EulerAngles object.
A boolean value that indicates whether this rotation is effectively an identity rotation (no rotation). Checks if the scalar part w of the internal quaternion is close to +/-1 and the vector part (x,y,z) is close to zero, within EPSILON(1e-6f) and EPSILON_SQ(1e-12f) tolerances.
The internal unit quaternion that represents this rotation.