Description
The Normal
property of the Angles
struct returns a normalized version of the current Angles
instance. This means that each angle component (pitch, yaw, roll) is adjusted to fall within the range of (-180, 180] degrees. Normalizing angles is useful for ensuring that angle values are within a standard range, which can help prevent issues related to angle wrapping and comparison.
Usage
To use the Normal
property, simply access it on an instance of the Angles
struct. This will return a new Angles
instance with normalized values.
Example
// Example of using the Normal property
Angles angles = new Angles(270, -190, 360);
Angles normalizedAngles = angles.Normal;
// normalizedAngles now contains angles within the range (-180, 180]
// For example, normalizedAngles might be (-90, 170, 0)