Godot-proposals: Rename Transform to Transform3D for Godot 4.0

Created on 12 Nov 2020  路  1Comment  路  Source: godotengine/godot-proposals

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:

  • A data structure (https://docs.godotengine.org/en/latest/classes/class_transform.html).

  • A property (in GDScript it's transform but in C# it's Transform, so we have both Transform and Transform in C#).

  • An action ("to transform", "transforming", etc).

  • A generic word for transformations (including Transform2D).

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: https://github.com/godotengine/godot/pull/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.

core

Most helpful comment

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).

>All comments

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).

Was this page helpful?
0 / 5 - 0 ratings