使用球形线性 (slerp) 插值创建四元数曲线的样条曲线。
生成的曲线属于 C类 1。
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
对象,具有以下属性:
|
Throws:
-
DeveloperError : points.length 必须大于或等于 2。
-
DeveloperError : times.length 必须等于 points.length。
Members
readonly points : Array.<Quaternion>
Quaternion
个控制点的数组。
控制点的时间数组。
Methods
将给定时间限制为样条所覆盖的时间段。
Name | Type | Description |
---|---|---|
time |
number | 时间。 |
Returns:
时间,固定到动画周期。
evaluate(time, result) → Quaternion
在给定时间计算曲线。
Name | Type | Description |
---|---|---|
time |
number | 评估曲线的时间。 |
result |
Quaternion | optional 要在其上存储结果的对象。 |
Returns:
修改后的结果参数或给定时间曲线上点的新实例。
Throws:
-
DeveloperError : time must be in the range
[t0, tn]
, wheret0
is the first element in the arraytimes
andtn
is the last element in the arraytimes
.
在
times
中查找索引 i
,使得参数
times
在区间 [times[i], times[i + 1]]
中。
Name | Type | Description |
---|---|---|
time |
number | 时间。 |
Returns:
区间开始时元素的索引。
Throws:
将给定时间环绕到样条所覆盖的时间段。
Name | Type | Description |
---|---|---|
time |
number | 时间。 |
Returns:
时间,环绕到更新的动画。