Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly reverse and cross-fade animations in hand-controls component #5300

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Jun 8, 2023

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)

@mrxz mrxz force-pushed the hand-controls-animations branch from 55979d9 to f9370e0 Compare June 13, 2023 05:36
@dmarcos
Copy link
Member

dmarcos commented Jun 14, 2023

Thanks!

@dmarcos dmarcos merged commit f52ec24 into aframevr:master Jun 14, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants