SteppedSpline

new Cesium.SteppedSpline(options)

由分段常量组成的样条,表示阶跃函数。
Name Type Description
options object 包含以下属性的对象:
Name Type Description
times Array.<number> 一个严格递增、无单位、浮点数的时间数组,表示每个点的时间。这些值与时钟时间无关。它们是曲线的参数化。
points Array.<number> | Array.<Cartesian3> | Array.<Quaternion> 控制点的数组。
Throws:
Example:
const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
const spline = new Cesium.SteppedSpline({
    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>|Array.<Quaternion>

控制点的数组。

readonly times : Array.<number>

控制点的时间数组。

Methods

clampTime(time)number

将给定时间限制在样条覆盖的周期内。
Name Type Description
time number 当前时间。
Returns:
限制在动画周期内的时间。
在给定时间评估曲线。
Name Type Description
time number 要评估曲线的时间。
result Cartesian3 | Quaternion optional 存储结果的对象。
Returns:
修改后的结果参数或在给定时间的曲线上点的新实例。
Throws:
  • DeveloperError : time 必须在范围 [t0, tn] 内,其中 t0 是数组 times 中的第一个元素,而 tn 是最后一个元素 在数组 times 中。

findTimeInterval(time, startIndex)number

times 中找到一个索引 i,使得参数 time 在区间 [times[i], times[i + 1]] 内。
Name Type Description
time number 当前时间。
startIndex number 开始搜索的索引。
Returns:
区间开始处元素的索引。
Throws:
  • DeveloperError : time 必须在范围 [t0, tn] 内,其中 t0 是数组 times 中的第一个元素,而 tn 是最后一个元素 在数组 times 中。

wrapTime(time)number

将给定时间包装到样条覆盖的周期内。
Name Type Description
time number 当前时间。
Returns:
包装到更新动画内的时间。
需要帮助?获得答案的最快方法是来自社区和团队 Cesium Forum.