-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add is_conformal
method to Basis and Transform2D
#79523
Conversation
9ee0f11
to
4625cad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work :)
09681ac
to
d85f55b
Compare
1ae6529
to
38c7639
Compare
Updated the PR to have an optimized 3D implementation suggested by @SlugFiller. |
38c7639
to
96a959a
Compare
5008605
to
1fb56a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor issue nothing scary
1fb56a4
to
56806ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - probably @akien-mga should give it a check for merge
Thanks! |
This PR adds a new method
is_conformal
to Basis and Transform2D.This method returns true if the basis is conformal, meaning it preserves angles and distance ratios, and may only composed of rotation or uniform scale. Returns false if the basis has non-uniform scale or shear/skew.
This can be used to validate if the basis is non-distorted, which is important for physics and other use cases. I have wanted a method like this for a long time but I did not know what to call it before now.
This PR also includes documentation and test cases. Most of the added lines are test cases.
I plan to use this method in the engine in #79364, but I wanted to open this PR to add the method first.