-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Rename translate(d) to translate(d)_local in Transform 2D/3D #57698
Rename translate(d) to translate(d)_local in Transform 2D/3D #57698
Conversation
3da9f9e
to
f2256f4
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.
Looks good except we should also do the same change in C#.
f2256f4
to
674c2fb
Compare
Thanks, good catch, adapted now as well. Was this missed by a CI check or is the API consistency towards C# only verified manually in general? |
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.
@bluenote10 Only manually, we don't have any checks for this. At some point we should add test cases to C# which we can start by copying the ones from C++ (which would help verify equivalent behavior), but this is not a priority right now.
This PR looks good to me. Even without the rest of the discussed changes, this change makes sense on its own, so I think this is good, and then the rest of the changes can be in follow-up PRs.
@BastiaanOlij Hello Bastiaan, is there anything I can do to move forward with this PR and #55923? If it would e.g. help to have a call in person to walk you through the plan behind godotengine/godot-proposals#1336 I could surely arrange that. |
Hey @bluenote10, Sorry for not noticing this until now, also very interested in knowing about your Guitar VR project so if you have a link to what you're working on, I'd love to check it out. On topic, we had a big discussion some months ago about which way around things should be and what default behavior we expect. I can't fully remember what the outcome was there but it came down that the current approach was mostly correct. The problem being that there is a big disjoint between what is expected behavior for the different functions and that the need for their functional behavior is more important than consistency in behavior. I can't remember what the outcome of the naming there was, whether we agreed that it would be assume that transform was local, and global_transform global, I vaguely remember we did want to replace the global name because that name can be misleading and rotation and scaling on global_transform is still a locally applied (and should be). So I'm not sure what the best forum is for getting consensus on the naming and whether we actually want to change anything here. |
@BastiaanOlij We had a discussion about this about a month ago. It was discussed that having both versions makes sense. I remember specifically that we brought up if there should be _global suffixes, but this was rejected because using the word global for parent-relative things was confusing, so it was decided that the self-relative versions should be named local and the parent-relative versions should have no suffix. Reduz commented on #55923 that it looks good as-is. However, there were some concerns in the discussion about mid-air conflicts with other PRs since it renames an existing method and adds a new one with the old name. This PR is a subset of the other one that only has the method rename to try and avoid mid-air conflicts. See the discussions in #55923 and godotengine/godot-proposals#1336 for more information. Also, these renames have nothing to do with transform or global_transform. This is about translate. |
I think everyone involved in the discussion on various GitHub threads was agreeing that the current inconsistency with mixing local and global operations is a design flaw that should be fixed before 4.0. The main question then became how to resolve the inconsistency: Either by breaking the behavior of the two functions ( |
7ac5c41
to
4f7c512
Compare
Mentioned in the PR review meeting, decided that @reduz would take a look separately. |
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.
This still looks good to me. It needs a rebase when you can.
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.
Checked against current master
and I don't see new translate()
/ translated()
calls added since the last rebase, so should be good to go.
Thanks! |
This is an accompanying PR for #55923 / godotengine/godot-proposals#1336.
It isolates the renaming for
translated
totranslated_local
(and in-place versions) without re-adding the same function with the new global semantics in the same PR to ensure that we have refactored 100% of occurrences if CI passes. This PR does nothing else.If we want to move forwards with #55923 the idea would be to merge this PR first, and then I'll rebase the other PR, which adds all remaining variants of translated/scaled/rotated. This will simplify the other diff and should make its review more convenient.