Rotation

表示一个 Packable 数字,总是朝着最短旋转角度插值。此对象从不直接使用, 而是传递给 SampledProperty 的构造函数,以表示二维旋转角度。
Example:
const time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');
const time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');
const time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');

const property = new Cesium.SampledProperty(Cesium.Rotation);
property.addSample(time1, 0);
property.addSample(time3, Cesium.Math.toRadians(350));

//获取time2时的值将等于355度而不是
//175度(如果使用SampledProperty(Number)会得到175度)。注意,实际
//返回值是弧度,不是度。
property.getValue(time2);
See:

Members

static Cesium.Rotation.packedLength : number

用于将对象打包到数组中的元素数量。

Methods

static Cesium.Rotation.convertPackedArrayForInterpolation(packedArray, startingIndex, lastIndex, result)

将打包数组转换为适合插值的格式。
Name Type Default Description
packedArray Array.<number> 打包数组。
startingIndex number 0 optional 要转换的第一个元素的索引。
lastIndex number packedArray.length optional 要转换的最后一个元素的索引。
result Array.<number> optional 用于存储结果的数组。

static Cesium.Rotation.pack(value, array, startingIndex)Array.<number>

将提供的实例存储到提供的数组中。
Name Type Default Description
value Rotation 要打包的值。
array Array.<number> 要打包到的数组。
startingIndex number 0 optional 开始打包元素的数组索引。
Returns:
被打包到的数组

static Cesium.Rotation.unpack(array, startingIndex, result)Rotation

从打包数组中检索实例。
Name Type Default Description
array Array.<number> 打包数组。
startingIndex number 0 optional 要解包的第一个元素的索引。
result Rotation optional 用于存储结果的对象。
Returns:
修改后的结果参数,如果未提供则返回新的Rotation实例。

static Cesium.Rotation.unpackInterpolationResult(array, sourceArray, firstIndex, lastIndex, result)Rotation

从使用 Rotation.convertPackedArrayForInterpolation 转换的打包数组中检索实例。
Name Type Default Description
array Array.<number> 之前为插值打包的数组。
sourceArray Array.<number> 原始打包数组。
firstIndex number 0 optional 用于转换数组的firstIndex。
lastIndex number packedArray.length optional 用于转换数组的lastIndex。
result Rotation optional 用于存储结果的对象。
Returns:
修改后的结果参数,如果未提供则返回新的Rotation实例。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.