new Cesium.CatmullRomSpline(options)

一个Catmull-Rom 线条是一个立方形线条,在控制点的切线, 除第一个和最后一个外,使用上一个和下一个控制点计算. Catmull-Rom splines are in the class C1.
Name Type Description
options object 下列属性的对象 :
Name Type Description
times Array.<number> 每个点都有严格递增的,无单位的,浮点时间的阵列. 数值与时钟时间绝无关联. 它们是曲线的参数化.
points Array.<Cartesian3> The array of Cartesian3 control points.
firstTangent Cartesian3 optional 第一个控制点的曲线正切值 . 未给定者,即为估定.
lastTangent Cartesian3 optional 曲线在最后一个控制点的正切值 . 未给定者,即为估定.
Throws:
Example:
// spline above the earth from Philadelphia to Los Angeles
const spline = new Cesium.CatmullRomSpline({
    times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
    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[i]);         // equal to positions[i]
const p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
See:

Members

readonly firstTangent : Cartesian3

第一控制点的正切值.

readonly lastTangent : Cartesian3

最后一个控制点的正切值 .

readonly points : Array.<Cartesian3>

An array of Cartesian3 control points.

readonly times : Array.<number>

用于控制点的一系列次数.

Methods

clampTime(time)number

将给定的时间压缩到线条覆盖的期间.
Name Type Description
time number The time.
Returns:
时间,夹在动画时期.

evaluate(time, result)Cartesian3

在特定时间评估曲线.
Name Type Description
time number 评估曲线的时间.
result Cartesian3 optional 存储结果的对象 .
Returns:
修改后的结果参数或给定时间曲线上点的新实例.
Throws:
  • DeveloperError : time must be in the range [t0, tn], where t0 is the first element in the array times and tn is the last element in the array times.

findTimeInterval(time)number

在 NT 2 times NT 3 中查找索引 NT 0 i NT 1 ,使参数如此 -NT+0 时间 NT+1 时间间隔 NT+2 [时间[i],时间[i+1]] NT+3 .
Name Type Description
time number The time.
Returns:
间隔开始时元素的索引.
Throws:
  • DeveloperError : time must be in the range [t0, tn], where t0 is the first element in the array times and tn is the last element in the array times.

wrapTime(time)number

将给定的时间包到线条覆盖的期间.
Name Type Description
time number The time.
Returns:
时间,包裹在更新的动画.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.