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

Implement cubic_interpolate() as MathFunc for refactoring #57954

Merged

Conversation

TokageItLab
Copy link
Member

@TokageItLab TokageItLab commented Feb 11, 2022

Implement cubic_interpolate() as built-in math function for refactoring animation and anywhere.

This is the first step in solving #57952. We need to change the formula to solve #57952 completely, but since there were many duplicated formulas, this change put them in one place.

@TokageItLab TokageItLab requested review from a team as code owners February 11, 2022 03:47
@TokageItLab TokageItLab changed the title Implement cubic_interpolate() as MathFunc to refactor Implement cubic_interpolate() as MathFunc for refactoring Feb 11, 2022
@TokageItLab TokageItLab force-pushed the refactor-cubic-interpolate branch 3 times, most recently from cce2228 to 1032c0d Compare February 11, 2022 03:59
@TokageItLab TokageItLab added this to the 4.0 milestone Feb 11, 2022
core/math/math_funcs.h Outdated Show resolved Hide resolved
@TokageItLab TokageItLab force-pushed the refactor-cubic-interpolate branch 2 times, most recently from 908ec7f to 411882f Compare February 12, 2022 01:32
@sairam4123
Copy link

I'd recommend calling it cubic_lerp instead to be in par with lerp function.

@aaronfranke
Copy link
Member

@sairam4123 The "l" in "lerp" stands for "linear" so "cubic_lerp" would not be an appropriate name. We discussed the naming back when "lerp" was called "linear_interpolate" and decided to shorten it to "lerp", but "cubic_interpolate" does not have a common shortened version, "cerp" would sounds weird.

@TokageItLab
Copy link
Member Author

TokageItLab commented Feb 13, 2022

As aaronfranke said right, lerp is an abbreviation for linear-interpolate. If you want to make a comparison, it would be more correct to make lerp() into linear_interpolate() and slerp() into spherical_linear_interpolate(), but I don't think it is worth it.

@sairam4123
Copy link

sairam4123 commented Feb 13, 2022 via email

@akien-mga akien-mga merged commit 7224389 into godotengine:master Feb 13, 2022
@akien-mga
Copy link
Member

Thanks!

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.

4 participants