The Rotation
field of the Transform
struct represents the rotational component of the transform. It defines the orientation of the transform in 3D space.
The Rotation
field of the Transform
struct represents the rotational component of the transform. It defines the orientation of the transform in 3D space.
Use the Rotation
field to get or set the orientation of a Transform
object. This field is particularly useful when you need to manipulate the rotation of an entity, bone, or scene object in the game engine.
// Example of setting the rotation of a Transform Transform myTransform = new Transform(); myTransform.Rotation = Rotation.FromAxis(Vector3.Up, 90); // Rotate 90 degrees around the Up axis // Example of getting the rotation of a Transform Rotation currentRotation = myTransform.Rotation; // Use the rotation to perform further operations Vector3 forwardDirection = currentRotation.Forward;