static Angles Lerp( Angles& source, Angles& target, float frac )

book_4_sparkGenerated
code_blocksInput

Description

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.

Usage

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. Values between 0 and 1 interpolate between the two.

Example

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 halfway between source and target.