-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Matrix3/4: Refactor getInverse(). #18885
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
Conversation
|
/ping @bhouston Opinion requested.
|
|
I think we should give this a try. #17926 (comment) |
|
Thanks! |
|
There is not going to be any discussion now. |
|
We can definitely have discussion. And we can revert if we come up with arguments to do so. But up until now this topic has been based on theory and correctness, but I'm curious to see how/if it affects users in practice. |
|
The fact that we're aligning with Unity also makes me feel more comfortable about this change. |
|
The change is fine if you want. That is not the point. The API has changed -- and there is no warning to the user that the arg they pass is ignored. |
|
Yeah, I understand. It's just that these methods look much more clean now... You don't think stating it in the migration page is good enough? |
|
With a signature change, we add a waning inline that the arg is no longer honored. I am not aware of any exceptions to that policy. We will get feedback if users find the change troubling. |
|
I don't remember exactly which change was... but I remember changing signatures and people notifying us that they would have benefited from a warning and us adding a warning in the next version. |
|
But I see your point. This doesn't look too bad? getInverse: function ( m, throwOnDegenerate ) {
if ( throwOnDegenerate !== undefined ) {
console.error( "THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate." );
} |
|
I think that would be fine -- and appropriate. |
|
Done! 6c3db4b |
that does make sense, if you think about it. if you pass 0 and get 1 as inverse, you can invert it again and conclude that the original was 1 (incorrectly). ...but if you get 0 for inverse, and invert it back, you get 0, see 😝 |

Fixed #17926.
This PR changes the behavior of
getInverse()when a matrix is processes with a determinant of zero. Similar to Unity's Matrix4x4.inverse, the method does not log a warning anymore but just return a zero matrix.