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

Physics.Arcade.Body.hitTest - bug with circles #4748

Closed
funnisimo opened this issue Sep 12, 2019 · 0 comments
Closed

Physics.Arcade.Body.hitTest - bug with circles #4748

funnisimo opened this issue Sep 12, 2019 · 0 comments

Comments

@funnisimo
Copy link
Contributor

Version

  • Phaser Version: 3.19
  • Operating system: N/A
  • Browser: N/A

Description

The default Physics.Arcade.Body.hitTest calls Geom.Circle.Contains to do hit testing. However, Contains expects a circle object that uses x, y as the center of the circle. The Body uses x, y as the top, left of the body so the hitTest is off.

Example Test Code

https://codepen.io/funnisimo/pen/dybKPjG

Additional Information

Also, setOffset needs to call updateCenter

photonstorm added a commit that referenced this issue Sep 26, 2019
Fix for Issue #4748 - Physics.Arcade.Body.hitTest - bug with circles
cristlee pushed a commit to cristlee/phaser that referenced this issue Sep 27, 2019
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