Rotation ToRotation()

robot_2Generated
code_blocksInput

Description

Converts the current Euler angles to a Rotation object. The angles will be normalized during this conversion process.

Usage

Use this method when you need to convert Euler angles, represented by the Angles struct, into a Rotation object. This is useful for scenarios where you need a rotation representation that avoids issues like gimbal lock and provides a more stable and consistent way to handle rotations in 3D space.

Example

// Example of converting Angles to Rotation
Angles angles = new Angles(30, 45, 60);
Rotation rotation = angles.ToRotation();

// Use the rotation in a scene or with a GameObject
GameObject myObject = new GameObject();
myObject.Rotation = rotation;