Rotation

Represents a Packable number that always interpolates values towards the shortest angle of rotation. This object is never used directly but is instead passed to the constructor of SampledProperty in order to represent a two-dimensional angle of rotation.
Example:
var time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');
var time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');
var time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');

var 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

staticCesium.Rotation.packedLength : Number

The number of elements used to pack the object into an array.

Methods

staticCesium.Rotation.convertPackedArrayForInterpolation(packedArray, startingIndex, lastIndex, result)

Converts a packed array into a form suitable for interpolation.
Name Type Default Description
packedArray Array.<Number> The packed array.
startingIndex Number 0 optional The index of the first element to be converted.
lastIndex Number packedArray.length optional The index of the last element to be converted.
result Array.<Number> The object into which to store the result.

staticCesium.Rotation.pack(value, array, startingIndex)Array.<Number>

Stores the provided instance into the provided array.
Name Type Default Description
value Rotation The value to pack.
array Array.<Number> The array to pack into.
startingIndex Number 0 optional The index into the array at which to start packing the elements.
Returns:
The array that was packed into

staticCesium.Rotation.unpack(array, startingIndex, result)Rotation

Retrieves an instance from a packed array.
Name Type Default Description
array Array.<Number> The packed array.
startingIndex Number 0 optional The starting index of the element to be unpacked.
result Rotation optional The object into which to store the result.
Returns:
The modified result parameter or a new Rotation instance if one was not provided.

staticCesium.Rotation.unpackInterpolationResult(array, sourceArray, startingIndex, lastIndex, result)Rotation

Retrieves an instance from a packed array converted with Rotation.convertPackedArrayForInterpolation.
Name Type Default Description
array Array.<Number> The array previously packed for interpolation.
sourceArray Array.<Number> The original packed array.
startingIndex Number 0 optional The startingIndex used to convert the array.
lastIndex Number packedArray.length optional The lastIndex used to convert the array.
result Rotation optional The object into which to store the result.
Returns:
The modified result parameter or a new Rotation instance if one was not provided.