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

New feature: Animation Modes #101

Open
wants to merge 4 commits into
base: mc1.20.1
Choose a base branch
from

Conversation

Rikaisan
Copy link


Name: Feature Merge
Title: Animation Modes
About: Be able to change the way the Animatronic animates/tweens between poses.
Labels: Enhancement
Assignees: Rikaisan


Description

I wanted to make an animatronic that had a really snappy and quick animation (think about a glitching/faulty robot), but that was not possible with the current implementation, so I added a new API to support what I needed + future expansion possibilities to the Animatronic:

animatronic.setAnimationType(mode) where mode can be either rusty or raw for now

The idea behind this implementation is to be able to add and support new tweening functions in the future with ease, think about the classic quadraticIn, exponentialOut, easeInOut, bounceIn and any other functions you might encounter in animation software.

Currently, I left the animation mode that was already implemented: 'rusty' as the default and added a new one: 'raw' which will skip the animation and just change the pose instantly to the one provided by the user when calling animatronic.push().

For now, the implementation is using a switch statement to not over-complicate the code, however, if many more modes are expected to be added in the future, it might be worth it to create an interface for animation modes.

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.

1 participant