Interpolation.Lerp
Static Method in Interpolation
Declaration
public static float Lerp(float a, float b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| float | The interpolated value between the start and end value. |
Overload
Declaration
public static double Lerp(double a, double b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| double | The interpolated value between the start and end value. |
Overload
Declaration
public static int Lerp(int a, int b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| int | The interpolated value between the start and end value. |
Overload
Declaration
public static long Lerp(long a, long b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| long | The interpolated value between the start and end value. |
Overload
Declaration
public static short Lerp(short a, short b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| short | The interpolated value between the start and end value. |
Overload
Declaration
public static Vector2 Lerp(Vector2 a, Vector2 b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| Vector2 | The interpolated value between the start and end value. |
Overload
Declaration
public static Vector2Int Lerp(Vector2Int a, Vector2Int b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| Vector2Int | The interpolated value between the start and end value. |
Overload
Declaration
public static Vector3 Lerp(Vector3 a, Vector3 b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| Vector3 | The interpolated value between the start and end value. |
Overload
Declaration
public static Vector3Int Lerp(Vector3Int a, Vector3Int b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| Vector3Int | The interpolated value between the start and end value. |
Overload
Declaration
public static Vector4 Lerp(Vector4 a, Vector4 b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| Vector4 | The interpolated value between the start and end value. |
Overload
Declaration
public static Quaternion Lerp(Quaternion a, Quaternion b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| Quaternion | The interpolated value between the start and end value. |
Overload
Declaration
public static Rect Lerp(Rect a, Rect b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| Rect | The interpolated value between the start and end value. |
Overload
Declaration
public static Color Lerp(Color a, Color b, float t, bool snapping = false)Description
Linearly interpolates between a and b by t.
Parameters
| a | The start value. |
| b | The end value. |
| t | The interpolation value between the start and end value. |
| snapping | Snaps the interpolated value to the nearest whole number. |
Returns
| Color | The interpolated value between the start and end value. |