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

CompositeColliders treat separate constituents as separate collisionstart/collisionend which is unexpected #2300

Closed
eonarheim opened this issue Apr 17, 2022 · 0 comments · Fixed by #2301
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior

Comments

@eonarheim
Copy link
Member

This issue was bought to our attention by @Cretezy in this excalibur-tiled issue excaliburjs/excalibur-tiled#344 (comment)

quickshare-2022-04-15_12.39.38.mp4

Steps to Reproduce

This is easiest to reproduce with a TileMap or a CompositeCollider where a geometry seam is created.

This can be reproduced in the sandbox environment by carving out a gap and walking across the seams.

image

Expected Result

Only 1 collisionstart/collisionend pair should be fired while colliding with the CompositeCollider

Actual Result

New collisionstart/collisionend are fired when a geometry seam is crossed

Environment

  • browsers and versions: Chrome 100
  • operating system: Win11
  • Excalibur versions: latest main

Current Workaround

None

@eonarheim eonarheim added the bug This issue describes undesirable, incorrect, or unexpected behavior label Apr 17, 2022
eonarheim added a commit that referenced this issue Apr 17, 2022
eonarheim added a commit that referenced this issue Apr 23, 2022
…ollisionend events (#2301)

Closes #2300 

This PR solves the issue of duplicate `collisionstart`/`collisionend` events by keeping track of the `CompositeCollider` in the contact id (which makes it no longer unique) but allows the dispatch logic for start/end to work unchanged in the `CollisionSystem`. This is done with a slightly gross hack to decorate colliders with a composite id if they are part of a composite collider.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Projects
None yet
1 participant