Skip to content

fix: Fix calculation of AABB for ShapeHitboxes#1481

Merged
spydon merged 12 commits intomainfrom
spydon.fix-on-top-collisions
Mar 27, 2022
Merged

fix: Fix calculation of AABB for ShapeHitboxes#1481
spydon merged 12 commits intomainfrom
spydon.fix-on-top-collisions

Conversation

@spydon
Copy link
Copy Markdown
Member

@spydon spydon commented Mar 22, 2022

Description

Tried to reproduce #1478 without luck.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples.

Breaking Change

  • No, this is not a breaking change.

Related Issues

Closes #1478

@st-pasha
Copy link
Copy Markdown
Contributor

What would be the reported set of intersection points in this case?

@spydon
Copy link
Copy Markdown
Member Author

spydon commented Mar 23, 2022

What would be the reported set of intersection points in this case?

In the bug report you mean? Both start and end seems to be called for every tick.

@st-pasha
Copy link
Copy Markdown
Contributor

I mean, normally when 2 shapes collide, we compute their set of collision points. But here the two shapes overlap exactly, so I was wondering what's going to happen to that set (in theory there are infinite number of collision points now). A circle-on-circle overlap would be interesting too...

@spydon
Copy link
Copy Markdown
Member Author

spydon commented Mar 23, 2022

I mean, normally when 2 shapes collide, we compute their set of collision points. But here the two shapes overlap exactly, so I was wondering what's going to happen to that set (in theory there are infinite number of collision points now). A circle-on-circle overlap would be interesting too...

Aah, now I get what you mean, with polygon collisions that have lines that are on each other the intersections points will be formed by the line that is created by each overlap and the points will be the start, end and middle of that line.
For circles that are exactly on top of each other four intersection points with pi/2 angle between them will be reported.

@spydon spydon changed the title chore: Add test for hitboxes "on top" of each other fix: Fix calculation of AABB for ShapeHitboxes Mar 24, 2022
@spydon spydon merged commit a559d9a into main Mar 27, 2022
@spydon spydon deleted the spydon.fix-on-top-collisions branch March 27, 2022 21:31
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.

Collision callbacks start and end are called in the same tick with many added hitboxes

4 participants