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

Include 'global_basis' as Transform3D access property for Node3D class #6229

Closed
qaptoR opened this issue Feb 3, 2023 · 0 comments · Fixed by godotengine/godot#80512
Closed

Comments

@qaptoR
Copy link

qaptoR commented Feb 3, 2023

Describe the project you are working on

Anything in 3D

Describe the problem or limitation you are having in your project

GDScript 2.0 updated the api for Node3D to provide clear access properties to the underlying Transform3D such as

  • position, global_position
  • rotation, global_rotation
  • rotation_degrees, global_rotation_degrees

but for the Transform3D.basis we only get

  • basis

which while not being clearly documented as the local basis, it also does not have an accompanying 'global_basis' access property.

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

For consistency, the documentation for the basis access property should be made clear it is local at a minimum.

Secondary to that, the api should also include global_basis for the same reason global_position or global_rotation_degrees exists.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

straightforward update to the Node3D class

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

the workaround is obvious. But the usability of this change is equally so.

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

considering that basis.z is the engine standard way for getting the forward vector of a node, and that this is a commonly used value in game development, barring the inclusion of access properties like those listed below, basis.z and global_basis.z are appropriate compromises.

eg.

  • forward, global_forward
  • right, global_right
  • up, global_up

edit:
I will be making this change for myself regardless. Therefore if this is approved with enough support there should already be a PR more or less ready to go.

here is a link to the branch where the changes are implemented for anyone who would like to verify what changes were necessary to accomplish this proposal.
https://github.com/qaptoR/godot/tree/master_node3d_global_basis

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