- rename _prevAnimationTime to _prevAnimationDelta
- rewrite the _prevAnimationDelta bailout
- add a test that we animate while paused if animateWhilePaused is true, and update the existing test to check that we don't animate while paused when animateWhilePaused is false
Cesium currently only supports time based animation. This can
be inconvenient if the phase of the animation is related to
something other than time (eg distance along a path of an
object moving at a variable speed).
This came up before in #7361, but the author was persuaded that
it was better to use nodeTransformations to explicitly control
the model. That was (just) doable with that example, because
there were just 3 pairs of wheels, all of which needed the
exact same, relatively trivial, transformations. The proposed
solution was also cumbersome, relying on modifying `multiplier`
on the fly, with the downside that modifying multiplier also
reset the phase of the animation.
For more complex models, with less uniform animations, this
approach isn't really doable - especially if you want the same
code to work for multiple models.
This adds an animationTime function to ModelAnimation. If set,
it's used by ModelAnimationCollection.update to compute the
localAnimationTime, rather than using the current clock time.
I also added an animateWhilePaused property to
ModelAnimationCollection. When false (the default), we continue
to do the short circuit exit from ModelAnimationCollection.update
when the scene time hasn't changed. When true, a suitable
animationTime function can continue to animate the model, even when
scene time is paused.
The new sandcastle example is just a clone of Time Dynamic Wheels,
rewritten to use Cesium_Man.glb, and the new functionality.