使用球面線性(SLERP)插值創(chuàng)建四元數(shù)曲線的樣條曲線。生成的曲線屬于C1類。
new QuaternionSpline(options)
Parameters:
options
(Object)
| Name | Description |
|---|---|
options.times
Array.<Number>
|
在每個(gè)點(diǎn)上嚴(yán)格遞增的、無單位的浮點(diǎn)時(shí)間數(shù)組。這些值與時(shí)鐘時(shí)間沒有任何關(guān)系。它們是曲線的參數(shù)化。 |
options.points
Array.<Quaternion>
|
Quaternion控制點(diǎn)數(shù)組。
|
Throws
-
DeveloperError : points.length必須大于或等于2。
-
DeveloperError : times.length必須等于points.length。
Members
(readonly) points : Array.<Quaternion>
Quaternion控制點(diǎn)數(shù)組。
(readonly) times : Array.<Number>
控制點(diǎn)的時(shí)間數(shù)組。
Methods
clampTime(time) → {Number}
將給定的時(shí)間鉗制到樣條曲線所覆蓋的周期。
Parameters:
time
(Number)
時(shí)間。
在給定時(shí)間計(jì)算曲線。
Parameters:
time
(Number)
評估曲線的時(shí)間。
Throws
-
DeveloperError : 時(shí)間必須在
[t0, tn]范圍內(nèi),其中t0是數(shù)組times中的第一個(gè)元素,tn是數(shù)組times中的最后一個(gè)元素。
在
times中查找索引i,以便參數(shù)time在間隔[times[i], times[i + 1]]中。
Parameters:
time
(Number)
時(shí)間。
Throws
-
DeveloperError : 時(shí)間必須在
[t0, tn]范圍內(nèi),其中t0是數(shù)組times中的第一個(gè)元素,tn是數(shù)組times中的最后一個(gè)元素。
將給定時(shí)間包裝到樣條曲線所覆蓋的周期。
Parameters:
time
(Number)
時(shí)間。