WeightSpline

new Cesium.WeightSpline(options)

对变形目标使用的权重值数组进行线性插值的样条线。
Name Type Description
options Object 具有以下属性的对象:
Name Type Description
times Array.<Number> 在每个点上严格递增的、无单位的浮点时间的数组。 这些值与时钟时间没有任何关系。它们是曲线的参数化。
weights Array.<Number> 给定的浮点控制权数组。重量是这样排列的 目标的所有权重都是按时间顺序和它们出现的顺序给出的 变形目标来自的glTF。这意味着对于2个目标,权重=[w(0,0),w(0,1),w(1,0),w(1,1)…] 其中i和j in w(i,j)分别是时间指数和目标指数。
Throws:
Example:
var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
var weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets
var spline = new Cesium.WeightSpline({
    times : times,
    weights : weights
});

var p0 = spline.evaluate(times[0]);
See:

Members

readonly times : Array.<Number>

控制权重的时间数组。

readonly weights : Array.<Number>

浮点数组控制权的数组。

Methods

clampTime(time)Number

将给定时间钳制到样条曲线覆盖的周期。
Name Type Description
time Number 时间。
Returns:
时间,固定到动画周期。

evaluate(time, result)Array.<Number>

在给定时间计算曲线。
Name Type Description
time Number 计算曲线的时间。
result Array.<Number> optional 要将结果存储到的对象。
Returns:
在给定时间修改的结果参数或曲线上点的新实例。
Throws:
  • DeveloperError :时间必须在[t0, tn]范围内,其中t0 是数组times中的第一个元素,tn是最后一个元素 在数组times中。

findTimeInterval(time)Number

fi将索引i放入times中,使参数 time[times[i], times[i + 1]]区间。
Name Type Description
time Number 时间。
Returns:
间隔开始时元素的索引。
Throws:
  • DeveloperError :时间必须在[t0, tn]范围内,其中t0 是数组times中的第一个元素,tn是最后一个元素 在数组times中。

wrapTime(time)Number

将给定时间包装为样条曲线覆盖的周期。
Name Type Description
time Number 时间。
Returns:
时间,绕到更新的动画。