Skip to content

Home > @esengine/ecs-framework-monorepo > Interpolation

Interpolation class

插值工具类

提供各种类型的插值功能,用于创建平滑的数值变化

Signature:

typescript
export declare class Interpolation

Methods

Method

Modifiers

Description

angle(from, to, t)

static

角度插值(处理角度环绕)

color(from, to, t)

static

颜色插值(RGB)

createCachedInterpolator(interpolator)

static

创建带缓存的插值器 用于需要重复插值相同起始和目标值的情况

createCompositeInterpolator(interpolators)

static

创建组合插值器(插值多个值)

createNumberInterpolator(from, to)

static

创建数值插值器

createVectorInterpolator(from, to)

static

创建向量插值器

cubicSpline(p0, p1, p2, p3, t)

static

三次样条插值

getPathLength(path, closed)

static

计算路径总长度

hermite(p0, m0, p1, m1, t)

static

Hermite插值

keyframe(keyframes, time, interpolator)

static

关键帧动画插值

number(from, to, t)

static

数值线性插值

pathInterpolation(path, t, closed)

static

路径插值(沿着由点组成的路径)

slerp(from, to, t)

static

球面线性插值(适用于方向向量)

spline(points, t)

static

样条曲线插值(通过多个控制点)

vector2(from, to, t)

static

向量线性插值

vectorSpline(points, t)

static

向量样条曲线插值

基于 MIT 许可证发布