-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
[Core] [Mono] [GDNative] Rename "linear_interpolate" methods to "lerp" #20371
Conversation
I don't think it a good idea for C# to diverge from the C++, GDNative and GDScript APIs, unless there's a strong reason why it should be different in C# from the other languages (like snake_case to PascalCase, etc.). I don't think this is the case, it's just a cosmetic change which breaks the correspondence between C++/GDNative/GDScript and C#. If we want to make this change, it should be done for all languages at once next time we decide to break API compatibility for cosmetic changes (#16863). |
If desired, I could add |
Thanks for the GDNative implementation! Unfortunately, breaking compatibility of the core struct is a NO-GO, so I will have to create a new GDNative core extension for any new changes. |
@karroffel I kept the existing methods, what else can be done to preserve compatibility? As a quick refernece, there's one commit at the bottom which has all the GDNative changes. If desired I could undo that commit so we can merge the rest. GDNative calling "linear_interpolate" from Core will still work since I left wrapper methods. |
e06cfc4
to
74b18b5
Compare
74b18b5
to
e08f9f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C# changes look good to me.
2bf3e4b
to
b215ecb
Compare
c58c7cf
to
a5e8d14
Compare
a5e8d14
to
b4d3b79
Compare
b4d3b79
to
7138ed7
Compare
7138ed7
to
74293d0
Compare
7027f42
to
bec88c4
Compare
2f8067b
to
ebc1bfc
Compare
658b771
to
87a4ee6
Compare
87a4ee6
to
577e73b
Compare
577e73b
to
7fc5a76
Compare
I'm adding the breaks compat label since this does break C# compatibility, which wasn't important back when this PR was created, but I think we care about C# compat now. For GDScript/etc there are still wrapper methods for There aren't deprecated aliases or anything as @akien-mga mentions above, but the wrapper methods can easily be converted when/if that system is added. |
C# compat matters if this is going to be cherry-picked. For 4.0 I plan to do a lot of breaking changes though, if I have the time. |
You can fully break compatibility, the aim is to make the API more consistent in 4.0 so we don't need to drag around compat methods forever. |
@akien-mga Done. |
e380dc7
to
d127558
Compare
f6284a4
to
41a1dd9
Compare
Will need yet another rebase. We can now break compat for GDNative too in 4.0, we'll want the API to match Core anyway so there's no way to presence compatibility without tons of outdated bindings. |
41a1dd9
to
540156b
Compare
Thanks! |
Lerp
is a much better name, it's shorter, more familiar, and it's consistent withlerp
,inverse_lerp
, andslerp
inmath_funcs.h
, and with Mono'sMathf.Lerp
andSlerp
methods.I made the changes for C#, C++, GDScript, and GDNative,
but I kept the old "linear_interpolate" methods as well to maintain backwards compatibility.