Method Wlerp01
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Wlerp01(float, float, float)
Linearly interpolates between two values between 0 and 1 if values wrap around from 1 back to 0.
public static float Wlerp01(float v1, float v2, float t)
Parameters
Returns
Examples
float angleInRad1 = 1;
float angleInRad2 = 5;
float revolution = Mathf.PI * 2;
float interpolation = WLerp(angleInRad1 / revolution, angleInRad2 / revolution, 0.5f);
//interpolation == (5 + 1 + Mathf.PI * 2)/2 = 3 + Mathf.PI
Remarks
This is useful, for example, in lerping between angles.