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

Bug: Matrix decompose() method doesn't work correctly with mirrored matrix #11197

Open
amoffat opened this issue Jan 13, 2025 · 0 comments
Open

Comments

@amoffat
Copy link

amoffat commented Jan 13, 2025

Current Behavior

When a Matrix with a rotation has a "mirroring" scale, such as -1 across X or Y axis, calling .decompose() on the matrix produces skew values, and no rotation value, on the returned Transform object.

Expected Behavior

The basis vectors of the matrix are still orthogonal in this case, so .decompose() should return a rotation if the matrix has a rotation. No skew values.

Steps to Reproduce

  1. Create a new Matrix
  2. Apply a rotation with .rotate(rad)
  3. Apply a mirror with .scale(-1, 1)
  4. Create a new Transform
  5. Call .decompose(t)
  6. Observe t.rotation is 0

Environment

Possible Solution

The 2nd condition in this check should be expanded, though I'm not sure exactly what would be best. In my x-mirror example, delta was PI, and the condition failed.

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant