let me ask this in a better way,
In MonkeyTrap example animation system, we have the idea of interpolators and tasks, tasks can be paused/stopped or we can have unknown duration for continuous tasks. (for examples mobility animations like idle/walk)
seeing how stock tasks in MonkeyTrap have similarity to stock tweens we have in JME3.3
So how are the task and tween different???
Can we think of the task in MonkeyTrap example as a tween in the new animation system? Or tween is actually just an interpolator?
If tween is just an interpolator, then should the idea of tasks be added to the new animation system in JME 3.3 thus that the AnimComposer actually become a TaskComposer which runs tasks instead of raw tweens?
MonkeyTrap is kind of an ancient take on ideas that would evolve into something better that become Lemurâs animation system.
Remy based his JME animation refactoring on Lemurâs animation system but as I recall, itâs not a 1:1 mapping.
Lemur has the idea of Tweens and Animations. A Tween is something that will perform some kind of tweening between 0 and length. It can run forward/backward between 0 and length.
An Animation is responsible for making a Tween âgoâ based on timely updates. (public boolean animate( double tpf ) So an Animation would be the thing that loops. Pausing an animation is just not updating it anymore. Continue to update it and it will continue to go where it left off.
I donât remember how/if these concepts were translated exactly into JMEâs animation system. But I do know that animations loop (and tweens donât or at least they shouldnât) and if you were to stop updating then things wouldnât move anymore.
Say you have a complicate chained tween which somewhere in the tween execution it attaches a spatial to rootNode and will remove it sometimes later in tween execution it can be at the end of tween for example, and suddenly the current tween is switched with another tween while it is running and we do not have a way to tell it to stop so the child tweens can do their cleanups when tween stoped. But using the Task mechanism you added in MonkeyTrap we can do such kind cleanup while pausing or stopping the task.
No, itâs all controlled from AI system in server. MobAnimationState in client listens to CharacterActionâs send from server. and there is possibility of an action to be failed or interrupted in AI thus it will reflected on the client an will stop or switch currently executing animation on the client.
There are other solutions like passing the cleanup stuff to be done in a control attached to spatial to clear it up when times come instead of doing it within tween itself.
I actually like the idea of Tasks you have introduced in MonkeyTrap and was thinking it could be complementary to be added into JMEâs new animation system as well.
HmmâŚ, I guess the problem is that the AnimComposer in the new animation system directly tries to make a Tween to âgoâ and does not use any means of external thing like âAnimationâ or âTaskâ.
Both âAnimationâ (in Lemur) and âTaskâ (in MonkeyTrap) can wrap tween/interpolator and they expose a method for canceling, which could be overridden by the user to do whatever he wants when it is stopped.
Edit:
Actually, the new animation system uses an âActionâ class to wrap other tweens but âActionâ itself is a tween and could not be thought of like an Animation or Task I guess?
I guess a reverse() tween was never added. It would be simple enough, though.
Iâm not sure why loop is in there. Maybe I originally thought that a loop would always be running.
Then again, I wonder if there is some logic in looping where itâs still running but t could be negative. Maybe thatâs the case I was trying to handle but left out an or somewhere.
The issue for sequences is that they will âcatch upâ to whatever time they were given. So if you give them the end time then they will perform everything up until that.
Often thatâs what you want because many times sequences can only be run in one direction.
You should instead make a backwards sequence and invert just the âWalkâ, I guess.
Note: this may also be why there is no built in inverse. A sequence like âadd spatial, move spatial, remove spatialâ makes no sense backwards.
Itâs a similar problem to canceling tweens⌠because for a sequence() itâs unclear what cleaning up would do.
This is why in Lemur the idea of channels, canceling, reversing, etc⌠is at the Effect level where you potentially make entire new animations to do something backwards.