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: should not be assumed to always interact with the same group #76

Merged
merged 3 commits into from
May 30, 2024

Conversation

noih
Copy link
Contributor

@noih noih commented May 25, 2024

The interactive group is set by the users and should not be assumed to always interact with the same group. For example, a circle can also collide with a rectangle, but they still belong to different groups.

Stress testing is set to the same group only for testing purposes.

Here are two links for reference:
Box2d Doc
Box2D Tutorial: Collision filtering

@noih
Copy link
Contributor Author

noih commented May 26, 2024

Based on the concept of specifying interact rather than just being in the same group, naming the checking function canInteract or checkInteract is more appropriate.

@Prozi
Copy link
Owner

Prozi commented May 27, 2024

this is sweet thanks again!! @noih

but I'd like to also create some kind of util/function for

(BodyGroup.Ellipse << 16) | BodyGroup.Ellipse;

this (SOMEGROUP1 << 16) | SOMEGROUP2 could have some function cause I dont believe this is clear

thx !!!

can u suggest something?

@noih
Copy link
Contributor Author

noih commented May 27, 2024

I added a groupBits utility function. Hopefully that is helpful.

@Prozi
Copy link
Owner

Prozi commented May 30, 2024

I added a groupBits utility function. Hopefully that is helpful.

this is I think what I meant

Copy link
Owner

@Prozi Prozi left a comment

Choose a reason for hiding this comment

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

this looks very nice

thank you, again, for collaborating!

@Prozi Prozi merged commit be0dc9c into Prozi:master May 30, 2024
4 of 5 checks passed
@Prozi
Copy link
Owner

Prozi commented May 30, 2024

@noih here https://github.com/Prozi/detect-collisions/releases/tag/v9.8.0 <3

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.

None yet

2 participants