在变形目标使用的权重值数组上线性插值的样条曲线。
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
对象,具有以下属性:
|
Throws:
-
DeveloperError : weights.length must be greater than or equal to 2.
-
DeveloperError : times.length must be a factor of weights.length.
Example:
const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
const weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets
const spline = new Cesium.WeightSpline({
times : times,
weights : weights
});
const p0 = spline.evaluate(times[0]);
See:
Methods
将给定时间限制为样条所覆盖的时间段。
Name | Type | Description |
---|---|---|
time |
number | 时间。 |
Returns:
时间,固定到动画周期。
在给定时间计算曲线。
Name | Type | Description |
---|---|---|
time |
number | 评估曲线的时间。 |
result |
Array.<number> | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数 或给定时间曲线上点的新实例。
Throws:
在
times
中查找索引 i
,使得参数
times
在区间 [times[i], times[i + 1]]
中。
Name | Type | Description |
---|---|---|
time |
number | 时间。 |
Returns:
区间开始时元素的索引。
Throws:
将给定时间环绕到样条所覆盖的时间段。
Name | Type | Description |
---|---|---|
time |
number | 时间。 |
Returns:
时间,环绕到更新的动画。