Skip to content

KBE3D / KBCore / Cesium / QuaternionSpline

类: QuaternionSpline

A spline that uses spherical linear (slerp) interpolation to create a quaternion curve. The generated curve is in the class C<sup>1</sup>.

参数

Object with the following properties:

参数

An array of strictly increasing, unit-less, floating-point times at each point. The values are in no way connected to the clock time. They are the parameterization for the curve.

参数

The array of Quaternion control points.

属性

times

readonly times: number[]

An array of times for the control points.


points

readonly points: Quaternion[]

An array of Quaternion control points.

方法

findTimeInterval()

findTimeInterval(time: number): number

Finds an index <code>i</code> in <code>times</code> such that the parameter <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.

参数

time

number

The time.

返回

number

The index for the element at the start of the interval.


wrapTime()

wrapTime(time: number): number

Wraps the given time to the period covered by the spline.

参数

time

number

The time.

返回

number

The time, wrapped around to the updated animation.


clampTime()

clampTime(time: number): number

Clamps the given time to the period covered by the spline.

参数

time

number

The time.

返回

number

The time, clamped to the animation period.


evaluate()

evaluate(time: number, result?: Quaternion): Quaternion

Evaluates the curve at a given time.

参数

time

number

The time at which to evaluate the curve.

result?

Quaternion

The object onto which to store the result.

返回

Quaternion

The modified result parameter or a new instance of the point on the curve at the given time.

构造函数

构造函数

new QuaternionSpline(options: { times: number[]; points: Quaternion[]; }): QuaternionSpline

参数

options
times

number[]

points

Quaternion[]

返回

QuaternionSpline

KBE3D @3.0.0 Copyright © 2024-present KBE3D