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

Rename Transform to Transform3D for Godot 4.0 #1814

Closed
aaronfranke opened this issue Nov 12, 2020 · 3 comments · Fixed by godotengine/godot#38430
Closed

Rename Transform to Transform3D for Godot 4.0 #1814

aaronfranke opened this issue Nov 12, 2020 · 3 comments · Fixed by godotengine/godot#38430

Comments

@aaronfranke
Copy link
Member

aaronfranke commented Nov 12, 2020

Describe the project you are working on: This applies to any 3D game in Godot 4.0+.

Describe the problem or limitation you are having in your project:

We currently have this situation in the master branch (which will eventually become Godot 4.0):

  • Node2D has a Transform2D

  • Node3D has a Transform

To me, this seems inconsistent.

When talking about transforms, there is some confusion caused by the word "Transform" being simultaneously:

Also, there is an inconsistency with RemoteTransform3D being a remote Transform instead of a remote Transform3D.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:

If we renamed Transform to Transform3D, then we would have this situation:

  • Node2D has a Transform2D

  • Node3D has a Transform3D

There would be less confusion when discussing transforms, because then "Transform" by itself has one fewer possible meaning, and if you say "Transform3D" then you know it has to be referring to the data structure Transform3D. The C# code wouldn't have the problem of Transform vs Transform anymore, and RemoteTransform3D would be a remote Transform3D.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

This proposal can be implemented by renaming Transform to Transform3D.

Branch: https://github.com/aaronfranke/godot/tree/transform3d

PR: godotengine/godot#38430 (gets conflicts often, very important to rebase right before merging)

Another name to consider brought up by @AndreaCatania is Transform3 (and then making Transform2D be Transform2). However, I personally would prefer Transform3D. This is of course up for discussion.

If this enhancement will not be used often, can it be worked around with a few lines of script?:

The enhancement will be used often, as Transform(3D) is used by every 3D project.

Is there a reason why this should be core and not an add-on in the asset library?:

This can't be an add-on in the asset library, Transform(3D) is a core data structure.

@jonbonazza
Copy link

jonbonazza commented Nov 12, 2020

I think we should name it consistently with the other node renames (i.e. we renamed Spatial to Node3D, so this should be renamed Transform3D).

@andre-caldas
Copy link

To be really consistent, Vector2 should be renamed to Vector2D and Vector3, to Vector3D.

@aaronfranke
Copy link
Member Author

aaronfranke commented Sep 3, 2023

@andre-caldas I think Vector2 and Vector3 are fine as-is, because their usage is more general than transforms. You can use a Vector2 in a 3D game for things like movement input from the user. In contrast, Transform2D and Transform3D are very specific to describing space in those dimensions.

Also, Vector2 contains 2 floats, while Transform2D contains 6 floats. For Vector2, aside from to the number of dimensions the vector is in, the number 2 is also the number of floats that make up the vector. Similarly Vector3 contains 3 floats and Transform3D contains 12 floats.

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

Successfully merging a pull request may close this issue.

3 participants