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

[WIP] Fix bug in Plane transform with non-uniform scaling [4.x] #50551

Closed
wants to merge 1 commit into from

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Jul 17, 2021

Not up to date

Rather than keep both PRs up to date, I will get some feedback and finalize #50549 first, and then transfer to this version.

Fixes #50548

Basis b = basis;
b.invert();
b.transpose();
Vector3 normal = b.xform(p_plane.normal);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked the math, but maybe xform_inv is actually a faster shortcut to avoid computing the full inverse transpose matrix?

Copy link
Member Author

@lawnjelly lawnjelly Jul 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but I believe it isn't as robust as doing proper inverse transpose. On a similar note we need to check whether using the xform_inv function on the Vector3 in Transform3D::xform_inv is up to the job.

Copy link
Member Author

@lawnjelly lawnjelly Jul 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirmed, xform_inv doesn't work for Vector3 with non-uniform scales, so I'll change that.
DONE

@lawnjelly lawnjelly force-pushed the fix_plane_xform_4 branch from 563abd8 to d9ac56f Compare July 17, 2021 17:34
The previous version gave incorrect normals with non-uniform scaling.
@lawnjelly
Copy link
Member Author

Closing as replaced by #51355.

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

Successfully merging this pull request may close these issues.

Bug in Transform::xform(Plane) with non-uniform scaling
3 participants