-
-
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
Transform.xform_inv() is not the inverse of Transform.xform() #39433
Comments
Related to #26432? (Just a wild guess.) |
I have just been surprised to discover that there are two inverse functions: There is a warning in the description for There needs to be a similar health warning for the Anyway, I don't see the point to the (The other issue is about the orientation and handedness of the bases, not the scale.) |
What xform_inv does: |
@Jummit, you omitted the rotation part and the origin should be subtracted, not added. Current behaviour (for both 2D and 3D)For a vector
So current behaviour of these methods is consistent. However naming isn't good, since it's perfectly reasonable to assume that (for example) result of Possible changes(for both
What do you think about such changes? |
This issue goes a little deeper than this. The real culprit here is the
it also uses a simple transpose and even fails to utilize
|
Is this still the case in the latest documentation (4.2, 4.3)? It's a bit difficult to discern for me, given the removal of |
AFAICT there's currently no issue with the documentation, it should be resolved in 3.x by #49662 and in 4.x by #83461. Regarding #39433 (comment):
Such changes are compatibility breaking, they could have been considered for 4.0 back then indeed, but no such changes have been done. Hence I'd say in 4.x we're settled with the current behavior, which is valid and documented (even if methods' names are questionable etc.). So to me it seems that this issue can be closed, and if changes like suggested above are still desired then I think there should be a proposal opened for that in https://github.com/godotengine/godot-proposals (for consideration for 5.0 because of compat breaking nature). |
Godot version:
3.2.1.stable
OS/device including version:
Windows10
Issue description:
The documentation claims that: xform "Transforms the given Vector3 by this transform" and xform_inv "Inverse-transforms the given Vector3 by this transform." but it is not the case. The scale gets applied a second time instead of being undone.
https://docs.godotengine.org/en/stable/classes/class_transform.html?highlight=transform#class-transform-method-xform
Steps to reproduce:
Minimal reproduction project:
See above. (This has been simplified down from a more arbitrary transform I hit this problem with.)
The text was updated successfully, but these errors were encountered: