Description
The Rotation.FromRoll
method creates a new Rotation
instance representing a rotation around the roll axis by a specified angle in degrees. This method is useful when you need to create a rotation that only affects the roll component of an object, leaving the pitch and yaw components unchanged.
Usage
To use the FromRoll
method, call it with a single parameter specifying the roll angle in degrees. The method returns a Rotation
object that can be applied to game objects or used in calculations involving rotations.
Example
// Example of using Rotation.FromRoll
float rollAngle = 45.0f; // Roll angle in degrees
Rotation rollRotation = Rotation.FromRoll(rollAngle);
// Apply the roll rotation to a game object
GameObject myObject = new GameObject();
myObject.Rotation = rollRotation;