Angles WithRoll( float roll )

book_4_sparkGenerated
code_blocksInput

Description

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

Usage

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

Example

```csharp
// Create an Angles instance with initial pitch, yaw, and roll
Angles initialAngles = new Angles(30.0f, 45.0f, 60.0f);

// Update the roll value to 90.0f while keeping pitch and yaw unchanged
Angles updatedAngles = initialAngles.WithRoll(90.0f);

// Output the updated angles
// updatedAngles will have pitch = 30.0f, yaw = 45.0f, roll = 90.0f
```