AnimationTimeCallback

typealias AnimationTimeCallback = (duration: Double, seconds: Double) -> Double(source)

A function used to compute the local animation time for a ModelAnimation.

// Use real time for model animation (assuming animateWhilePaused was set to true)
function animationTime(duration) {
return Date.now() / 1000 / duration;
}
// Offset the phase of the animation, so it starts halfway through its cycle.
function animationTime(duration, seconds) {
return seconds / duration + 0.5;
}

Parameters

duration

The animation's original duration in seconds.

seconds

The seconds since the animation started, in scene time.

See also