Rotation

external object Rotation : Packable<JsDouble> (source)

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.

const time1 = JulianDate.fromIso8601('2010-05-07T00:00:00');
const time2 = JulianDate.fromIso8601('2010-05-07T00:01:00');
const time3 = JulianDate.fromIso8601('2010-05-07T00:02:00');

const property = new SampledProperty(Rotation);
property.addSample(time1, 0);
property.addSample(time3, 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 also

Properties

Link copied to clipboard
open external override val packedLength: Int

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

Functions

Link copied to clipboard
external fun convertPackedArrayForInterpolation(packedArray: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally, lastIndex: Int? = definedExternally, result: ReadonlyArray<JsDouble>? = definedExternally)

Converts a packed array into a form suitable for interpolation.

Link copied to clipboard
open external override fun pack(value: JsDouble, array: ReadonlyArray<JsDouble>, startingIndex: Int?): ReadonlyArray<JsDouble>

Stores the provided instance into the provided array.

Link copied to clipboard
open external override fun unpack(array: ReadonlyArray<JsDouble>, startingIndex: Int?, result: JsDouble?): JsDouble

Retrieves an instance from a packed array.

Link copied to clipboard
external fun unpackInterpolationResult(array: ReadonlyArray<JsDouble>, sourceArray: ReadonlyArray<JsDouble>, firstIndex: Int? = definedExternally, lastIndex: Int? = definedExternally, result: JsDouble? = definedExternally): JsDouble

Retrieves an instance from a packed array converted with Rotation.convertPackedArrayForInterpolation.