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

Fix rectangle transform #787

Merged
merged 6 commits into from
Sep 20, 2022

Conversation

toore
Copy link
Contributor

@toore toore commented Aug 28, 2022

Resolves #786.

Copy link
Contributor

@lithiumtoast lithiumtoast left a comment

Choose a reason for hiding this comment

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

Page 87 http://www.r-5.org/files/books/computers/algo-list/realtime-3d/Christer_Ericson-Real-Time_Collision_Detection-EN.pdf.

Screen Shot 2022-09-19 at 10 07 53 PM

Indeed I did not have this correct if unrolling the first loop for X and Y (only two dimensions in 2D instead of 3 in 3D), then unroll the second loop. The second loop is addition of a.r[j] which means yes, it should be HalfWidth = xRadius * Abs(M11) + yRadius * Abs(M12). Similar for HalfHeight but with i=1.

@lithiumtoast lithiumtoast merged commit 0ebbbe5 into craftworkgames:develop Sep 20, 2022
@toore toore deleted the bug-transform-rectangle branch September 23, 2022 14:19
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

Successfully merging this pull request may close these issues.

Transforming a RectangleF does not calculate bounding rectangle from the rotated original as intended
2 participants