Description
The WithYaw
method of the Angles
struct allows you to create a new Angles
instance with a specified yaw value, while keeping the existing pitch and roll values unchanged. This method is useful when you need to adjust the yaw component of an angle without affecting the other components.
Usage
To use the WithYaw
method, call it on an existing Angles
instance and pass the desired yaw value as a parameter. The method returns a new Angles
instance with the updated yaw value.
Example
```csharp
// Create an Angles instance with initial values
Angles initialAngles = new Angles(30.0f, 45.0f, 60.0f);
// Update the yaw value to 90.0f while keeping pitch and roll unchanged
Angles updatedAngles = initialAngles.WithYaw(90.0f);
// Output the updated angles
// updatedAngles will have pitch = 30.0f, yaw = 90.0f, roll = 60.0f
```