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