表示一個
Packable
數字,該數字始終向最短旋轉角度插入值。此對象從不直接使用,而是傳遞給SampledProperty
的構造函數,以表示二維旋轉角度。
Example
var time1 = bmgl.JulianDate.fromIso8601('2010-05-07T00:00:00');
var time2 = bmgl.JulianDate.fromIso8601('2010-05-07T00:01:00');
var time3 = bmgl.JulianDate.fromIso8601('2010-05-07T00:02:00');
var property = new bmgl.SampledProperty(bmgl.Rotation);
property.addSample(time1, 0);
property.addSample(time3, bmgl.Math.toRadians(350));
//Getting the value at time2 will equal 355 degrees instead
//of 175 degrees (which is what you get if you construct
//a SampledProperty(Number) instead. Note, the actual
//return value is in radians, not degrees.
property.getValue(time2);
- PackableForInterpolation
See:
Members
(static) packedLength : Number
用于將對象打包到數組中的元素數。
Methods
(static) convertPackedArrayForInterpolation(packedArray, startingIndex, lastIndex, result)
將壓縮數組轉換為適合插值的形式。
Parameters:
packedArray
(Array.<Number>)
壓縮數組。
startingIndex
(Number)
(default 0
)
要轉換的第一個元素的索引。
lastIndex
(Number)
(default packedArray.length
)
要轉換的最后一個元素的索引。
result
(Array.<Number>)
存儲結果的對象。
將提供的實例存儲到提供的數組中。
Parameters:
value
(Rotation)
要打包的值。
array
(Array.<Number>)
要打包的數組。
startingIndex
(Number)
(default 0
)
數組中開始打包元素的索引。
從壓縮數組中檢索實例。
Parameters:
array
(Array.<Number>)
壓縮數組。
startingIndex
(Number)
(default 0
)
要解包的元素的起始索引。
result
(Rotation)
存儲結果的對象。
從用
Rotation.convertPackedArrayForInterpolation
轉換的壓縮數組中檢索實例。
Parameters:
array
(Array.<Number>)
以前打包用于插值的數組。
sourceArray
(Array.<Number>)
原始壓縮數組。
firstIndex
(Number)
(default 0
)
用于轉換數組的FirstIndex。
lastIndex
(Number)
(default packedArray.length
)
用于轉換數組的最后一個索引。
result
(Rotation)
存儲結果的對象。