Description
The Rotation.Identity
field is a static, public field of the Rotation
struct. It represents a rotation that signifies no rotation, effectively serving as the default or neutral rotation state. This is equivalent to a quaternion with no rotation applied, often used as a starting point or reference in rotation calculations.
Usage
Use Rotation.Identity
when you need a baseline rotation that represents no change in orientation. This is particularly useful in scenarios where you want to reset an object's rotation or when initializing rotations to a default state.
Example
// Example of using Rotation.Identity
GameObject myObject = new GameObject();
myObject.Rotation = Rotation.Identity; // Sets the object's rotation to no rotation
// Check if a rotation is the identity rotation
Rotation currentRotation = myObject.Rotation;
bool isIdentity = currentRotation == Rotation.Identity; // true if no rotation is applied