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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

floatThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

doubleThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

intThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

longThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

shortThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

Vector2The 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

Vector2IntThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

Vector3The 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

Vector3IntThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

Vector4The 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

QuaternionThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

RectThe 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

aThe start value.
bThe end value.
tThe interpolation value between the start and end value.
snappingSnaps the interpolated value to the nearest whole number.

Returns

ColorThe interpolated value between the start and end value.