ConstantSpline

new Cesium.ConstantSpline(value)

A spline that evaluates to a constant value. Although this follows the Spline interface, it does not maintain an internal array of times since its value never changes.
Name Type Description
value Number | Cartesian3 | Quaternion The constant value that the spline evaluates to.
Example:
const position = new Cesium.Cartesian3(1.0, 2.0, 3.0);
const spline = new Cesium.ConstantSpline(position);

const p0 = spline.evaluate(0.0);
See:

Members

The constant value that the spline evaluates to.

Methods

clampTime(time)Number

Clamps the given time to the period covered by the spline.
Name Type Description
time Number The time.
Returns:
The time, clamped to the animation period.

evaluate(time, result)Number|Cartesian3|Quaternion

Evaluates the curve at a given time.
Name Type Description
time Number The time at which to evaluate the curve.
result Cartesian3 | Quaternion optional The object onto which to store the result.
Returns:
The modified result parameter or the value that the constant spline represents.

findTimeInterval(time)

Finds an index i in times such that the parameter time is in the interval [times[i], times[i + 1]]. Since a constant spline has no internal times array, this will throw an error.
Name Type Description
time Number The time.
Throws:
  • DeveloperError : findTimeInterval cannot be called on a ConstantSpline.

wrapTime(time)Number

Wraps the given time to the period covered by the spline.
Name Type Description
time Number The time.
Returns:
The time, wrapped around to the updated animation.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.