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:
Set the initial gesture to undefined instead of ANIMATIONS.open as the open animation is never used
In case of reversing a gesture simply reverse the timescale and unpause the corresponding action. This ensures that the animation is reversed from the right time in case the animation hadn't completed yet and avoids one frame of flickering.
Don't stop all actions when going from gesture to gesture to allow the cross-fade to work (otherwise the fromAction would've been reset by the stopAllActions call)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: