The Angles.Lerp
method performs a linear interpolation between two sets of Euler angles, source
and target
, based on a given fraction frac
. This method is useful for smoothly transitioning between two orientations over time.
The Angles.Lerp
method performs a linear interpolation between two sets of Euler angles, source
and target
, based on a given fraction frac
. This method is useful for smoothly transitioning between two orientations over time.
To use the Angles.Lerp
method, provide the source and target angles as references, along with a fraction value between 0 and 1. The fraction determines the interpolation point, where 0 returns the source angles and 1 returns the target angles.
Parameters:
source
(ref Angles
): The starting angles for the interpolation.target
(ref Angles
): The ending angles for the interpolation.frac
(System.Single
): A value between 0 and 1 indicating the interpolation factor.Returns: An Angles
object representing the interpolated angles.
Angles source = new Angles(0, 0, 0); Angles target = new Angles(90, 90, 90); float fraction = 0.5f; Angles result = Angles.Lerp(ref source, ref target, fraction); // result now holds the angles (45, 45, 45)