Module: 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.
Source:
See:
  • PackableForInterpolation
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);

Members

(static) packedLength :Number

The number of elements used to pack the object into an array.
Type:
  • Number
Source:

Methods

(static) convertPackedArrayForInterpolation(packedArray, startingIndexopt, lastIndexopt, result)

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

(static) pack(value, array, startingIndexopt) → {Array.<Number>}

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

(static) unpack(array, startingIndexopt, resultopt) → {Rotation}

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

(static) unpackInterpolationResult(array, sourceArray, startingIndexopt, lastIndexopt, resultopt) → {Rotation}

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