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));

//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);
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:
修改后的 result 参数,如果未提供则为新的 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:
修改后的 result 参数,如果未提供则为新的 Rotation 实例。
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。