The RotationToWorld
method of the Transform
struct converts a local rotation to a world rotation. This is useful when you need to transform a rotation that is defined in the local space of an object to the global world space.
The RotationToWorld
method of the Transform
struct converts a local rotation to a world rotation. This is useful when you need to transform a rotation that is defined in the local space of an object to the global world space.
To use the RotationToWorld
method, you need to have a Transform
instance. Call the method with a Rotation
parameter that represents the local rotation you want to convert. The method will return a Rotation
that represents the equivalent rotation in world space.
// Assume 'transform' is an instance of Transform Rotation localRotation = new Rotation(0, 90, 0); // Local rotation Rotation worldRotation = transform.RotationToWorld(localRotation); // 'worldRotation' now contains the rotation in world space