LinearSpline

new Cesium.LinearSpline(options)

使用分段线性插值创建曲线的样条曲线。
Name Type Description
options Object 具有以下属性的对象:
Name Type Description
times Array.<Number> 在每个点上严格递增的、无单位的浮点时间的数组。 这些值与时钟时间没有任何关系。它们是曲线的参数化。
points Array.<Cartesian3> Cartesian3控制点的数组。
Throws:
Example:
var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
var spline = new Cesium.LinearSpline({
    times : times,
    points : [
        new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
        new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
        new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
        new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
        new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
    ]
});

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

Members

readonly points : Array.<Cartesian3>

Cartesian3个控制点组成的数组。

readonly times : Array.<Number>

控制点的时间数组。

Methods

clampTime(time)Number

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

evaluate(time, result)Cartesian3

在给定时间计算曲线。
Name Type Description
time Number 计算曲线的时间。
result Cartesian3 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:
时间,绕到更新的动画。