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 = JulianDate.fromIso8601('2010-05-07T00:00:00');
var time2 = JulianDate.fromIso8601('2010-05-07T00:01:00');
var time3 = JulianDate.fromIso8601('2010-05-07T00:02:00');
var property = new SampledProperty(Rotation);
property.addSample(time1, 0);
property.addSample(time3, CesiumMath.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:
Source:
DataSources/Rotation.js, line 40
Members
-
staticRotation.packedLength :Number
-
The number of elements used to pack the object into an array.Source: DataSources/Rotation.js, line 45
Methods
-
staticRotation.convertPackedArrayForInterpolation(packedArray, startingIndex, lastIndex, result)
-
Converts a packed array into a form suitable for interpolation.
Name Type Default Description packedArrayArray.<Number> The packed array. startingIndexNumber 0optional The index of the first element to be converted. lastIndexNumber packedArray.lengthoptional The index of the last element to be converted. resultArray.<Number> The object into which to store the result. Source: DataSources/Rotation.js, line 98 -
staticRotation.pack(value, array, startingIndex)
-
Stores the provided instance into the provided array.
Name Type Default Description valueObject The value to pack. arrayArray.<Number> The array to pack into. startingIndexNumber 0optional The index into the array at which to start packing the elements. Source: DataSources/Rotation.js, line 55 -
staticRotation.unpack(array, startingIndex, result)
-
Retrieves an instance from a packed array.
Name Type Default Description arrayArray.<Number> The packed array. startingIndexNumber 0optional The starting index of the element to be unpacked. resultObject optional The object into which to store the result. Source: DataSources/Rotation.js, line 78 -
staticRotation.unpackInterpolationResult(array, sourceArray, startingIndex, lastIndex, result)
-
Retrieves an instance from a packed array converted with
Rotation.convertPackedArrayForInterpolation.Name Type Default Description arrayArray.<Number> The array previously packed for interpolation. sourceArrayArray.<Number> The original packed array. startingIndexNumber 0optional The startingIndex used to convert the array. lastIndexNumber packedArray.lengthoptional The lastIndex used to convert the array. resultObject optional The object into which to store the result.
