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

Add TRANS_SPRING to Tween #76899

Merged
merged 1 commit into from
May 22, 2023
Merged

Conversation

rakkarage
Copy link
Contributor

@rakkarage rakkarage commented May 10, 2023

once again:
#58999
sorry, thanks

Bugsquad edited: godotengine/godot-proposals#4212

Copy link
Member

@TokageItLab TokageItLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick look into spring tween, but could not find any details about its origin. What I did find is that the formula is similar to the Elastic formula when the spring formula is modified, and that unlike Elastic, the oscillation frequency is accelerated using the cubic of time.

I guessed that the approximate constant was determined to give a good number of about 3 bounds (there may be some additional bounds that are too small to be noticeable) with neat motion, but I don't know what the reason is.

For now, I only review the formulas and leave it to the production team to decide what to do about the license since this algorithm is probably a quote from somewhere.

scene/animation/easing_equations.h Outdated Show resolved Hide resolved
scene/animation/easing_equations.h Outdated Show resolved Hide resolved
scene/animation/easing_equations.h Outdated Show resolved Hide resolved
@rakkarage
Copy link
Contributor Author

  • uses real instead of float like rest of file

scene/animation/easing_equations.h Outdated Show resolved Hide resolved
Copy link
Member

@TokageItLab TokageItLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think now the behavior and code style are fine.

Well, it is unclear as to the original source of this code. I leave it to the production team to decide if there is a licensing concern.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tween cheat sheet with the new transition:
image
We'll need to update the image in the documentation.

@kleonc
Copy link
Member

kleonc commented May 19, 2023

@KoBeWi How is this cheat sheet generated? It could potentially be improved, like lines could be antialiased and the gaps could be eliminated (there are visible gaps e.g. near zero in elastic).

@KoBeWi
Copy link
Member

KoBeWi commented May 19, 2023

With this: https://github.com/wandomPewlin/godotTweeningCheatSheet
Note that the tool does not support Godot 4 yet, I was going send the updated code once this PR is merged.

@akien-mga akien-mga merged commit 7a17645 into godotengine:master May 22, 2023
@akien-mga
Copy link
Member

akien-mga commented May 22, 2023

Thanks! And congrats for your first merged Godot contribution 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants