LinearSpline

new Cesium.LinearSpline (options)

使用分段线性插值创建曲线的样条曲线。
Name Type Description
options Object 具有以下属性的对象:
姓名 类型 描述
times 数组.<数字> 每个点处严格递增的无单位浮点时间数组。这些值与时钟时间无关。它们是曲线的参数化。
points 数组。<数字> | 数组。< 笛卡尔3 > 控制点数组。
Throws:
Example:
const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
const 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)
    ]
});

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

Members

readonly points : Array.<Number>|Array.< Cartesian3 >

Cartesian3 控制点的数组。

readonly times : Array.<Number>

控制点的时间数组。

Methods

clampTime (time) Number

将给定时间限制在样条曲线覆盖的时间段内。
Name Type Description
time Number 时间。
Returns:
时间,夹在动画时期。

evaluate (time, result ) Number| Cartesian3

在给定时间评估曲线。
Name Type Description
time Number 评估曲线的时间。
result Cartesian3 可选 存储结果的对象。
Returns:
修改后的结果参数或给定时间曲线上点的新实例。
Throws:
  • DeveloperError : time 必须在 [t 0 , t n ] 范围内,其中 t 0 是数组 times 中的第一个元素, t n 是数组 times 中的最后一个元素。

findTimeInterval (time) Number

查找索引 i 以使参数 time 在区间 [ times [times[i], times[i + 1]] 中。
Name Type Description
time Number 时间。
Returns:
间隔开始处元素的索引。
Throws:
  • DeveloperError : time 必须在 [t 0 , t n ] 范围内,其中 t 0 是数组 times 中的第一个元素, t n 是数组 times 中的最后一个元素。

wrapTime (time) Number

将给定时间包装到样条覆盖的时间段。
Name Type Description
time Number 时间。
Returns:
时间,围绕着更新的动画。