Description
The Rotation.FromPitch
method creates a new Rotation
instance representing a rotation around the X-axis (pitch) by a specified angle in degrees. This method is useful for generating rotations that only affect the pitch component, leaving yaw and roll unaffected.
Usage
To use the Rotation.FromPitch
method, call it with a single float
parameter representing the pitch angle in degrees. The method returns a Rotation
object that can be used in various 3D transformations or calculations.
Example
// Example of using Rotation.FromPitch
float pitchAngle = 45.0f; // 45 degrees pitch
Rotation pitchRotation = Rotation.FromPitch(pitchAngle);
// Use the pitchRotation in a scene or apply it to a GameObject
GameObject myObject = new GameObject();
myObject.Transform.Rotation = pitchRotation;