Angles WithPitch( float pitch )

book_4_sparkGenerated
code_blocksInput

Description

The WithPitch method of the Angles struct allows you to create a new Angles instance with a specified pitch value, while keeping the yaw and roll values unchanged. This method is useful when you need to adjust the pitch component of an existing Angles object without affecting the other components.

Usage

To use the WithPitch method, call it on an existing Angles instance and pass the desired pitch value as a parameter. The method returns a new Angles instance with the updated pitch.

Example

```csharp
// Create an Angles instance with initial values
Angles originalAngles = new Angles(30.0f, 45.0f, 60.0f);

// Create a new Angles instance with a modified pitch
Angles newAngles = originalAngles.WithPitch(90.0f);

// Output the new angles
// newAngles will have pitch = 90.0f, yaw = 45.0f, roll = 60.0f
```