文档

Unity Engine

Unity Engine

Lerp

Linearly interpolates between two vectors.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

Lerp(Vector4, Vector4, float)

Linearly interpolates between two vectors.
public static Vector4 Lerp(Vector4 a, Vector4 b, float t)

Parameters

The first point to interpolate between.

The second point to interpolate between.

The amount to interpolate between.

Returns

Type

Description

Vector4When
t
is equal to 0, returns
a
. When
t
is equal to 1, returns
b
. When
t
is equal to 0.5, returns the midpoint of
a
and
b
.

Remarks

Interpolates between
a
and
b
by amount
t
.
The parameter
t
is clamped between [0...1].
When
t
= 0 returns
a
.
When
t
= 1 returns
b
.
When
t
= 0.5 returns the midpoint of
a
and
b
.
Additional Resources: Vector4.LerpUnclamped.

Lerp(Vector4, Vector4, float)

Linearly interpolates between two vectors.
public static Vector4 Lerp(in Vector4 a, in Vector4 b, float t)

Parameters

The first point to interpolate between.

The second point to interpolate between.

The amount to interpolate between.

Returns

Type

Description

Vector4When
t
is equal to 0, returns
a
. When
t
is equal to 1, returns
b
. When
t
is equal to 0.5, returns the midpoint of
a
and
b
.

Remarks

Interpolates between
a
and
b
by amount
t
.
The parameter
t
is clamped between [0...1].
When
t
= 0 returns
a
.
When
t
= 1 returns
b
.
When
t
= 0.5 returns the midpoint of
a
and
b
.
Additional Resources: Vector4.LerpUnclamped.