一种在 morph target 所使用的权重值数组上进行线性插值的样条曲线。
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
Throws:
-
DeveloperError : weights.length 必须大于或等于 2。
-
DeveloperError : times.length 必须是 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,使得参数
time 落在区间 [times[i], times[i + 1]] 内。
| Name | Type | Description |
|---|---|---|
time |
number | 时间。 |
Returns:
区间起始处元素的索引。
Throws:
将给定时间环绕到样条曲线所覆盖的时间段内。
| Name | Type | Description |
|---|---|---|
time |
number | 时间。 |
Returns:
已环绕到更新后动画的时间。
