Properly reverse and cross-fade animations in hand-controls component #5300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
The
hand-controls
component plays animations to transition the hand model into certain gestures. Going from one gesture to another attempts a cross-fade but this doesn't work and results in the full animation playing from the start. Similarly the reversing of an animation to go to the "no gesture" state fails to account for the situation where the animation hasn't completed yet and always results in a flicker frame where the hand is already in the "no gesture" state before animating.This PR addresses these to let the code behave in the way it seems it was originally intended. Obviously the cross-fading is not ideal (e.g. going from Point -> Point + Thumb moves all fingers slightly instead of just animating the thumb), but it at least doesn't snap to the "no gesture" state playing the full animation and results in a somewhat toned down animation.
Changes proposed:
undefined
instead ofANIMATIONS.open
as the open animation is never usedfromAction
would've been reset by thestopAllActions
call)