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
|
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: