export default class Interpolation { private static _interpolate; static linear(t: number, { preValue, nextValue }: { preValue: T; nextValue: T; }): T; static step(t: number, { preValue, nextValue }: { preValue: number[]; nextValue: number[]; }): number[]; private static _quaternionSlerp; /** * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#appendix-c-spline-interpolation tangents (ak, bk) and values (vk) are grouped within keyframes: a1,a2,...an,v1,v2,...vn,b1,b2,...bn Given a set of keyframes Input tk with Output in-tangent ak, point vk, and out-tangent bk for k = 1,...,n a spline segment between two keyframes is represented in a cubic Hermite spline form: p(t) = (2t3 - 3t2 + 1)p0 + (t3 - 2t2 + t)m0 + (-2t3 + 3t2)p1 + (t3 - t2)m1 where t is a value between 0 and 1 p0 is the starting point at t = 0 m0 is the scaled starting tangent at t = 0 p1 is the ending point at t = 1 m1 is the scaled ending tangent at t = 1 p(t) is the resulting point value and where at input offset tcurrent with keyframe index k t = (tcurrent - tk) / (tk+1 - tk) p0 = vk m0 = (tk+1 - tk)bk p1 = vk+1 m1 = (tk+1 - tk)ak+1 * * @param frameIndex * @param nextFrameIndex */ /** * 三次样条插值 * @param preValue * @param nextValue * @param t */ private static _cubicSpline; static cubicSpline(t: number, { preFrameIndex, nextFrameIndex, keyLength, keyFrames }: { preFrameIndex: any; nextFrameIndex: any; keyLength: any; keyFrames: any; }): any[]; }