notgiven688/jitterphysics2

IBroadPhaseFilter works the opposite of the way it should

RonenNess opened this issue · 3 comments

Check out the docs for IBroadPhaseFilter:

https://github.com/notgiven688/jitterphysics2/blob/e80205d51c3947efaf926d38c121800302be6ceb/src/Jitter2/Collision/CollisionFilter/IBroadPhaseFilter.cs#L38C1-L38C90

It says <returns>False if the collision should be filtered out; true otherwise.</returns>.

However, when setting a filter, if I return true it doesn't do collision, but if I return false, the objects do collide.

IMO the correct behavior is according to docs, ie true = collide, false = don't collide.
It makes more sense that way. But whatever you choose please make it consistent with the comment.

Thanks!

By the way if you want me to do PRs to fix the stuff I find let me know, I can help with that.

@RonenNess Thank you for finding/pointing out all these quirks and small glitches. This is exactly what the issue-tracker is for. I changed the definition of the Filter-Callbacks many times (there is also the NarrowPhase-Filter and the DynamicTree Filter https://github.com/notgiven688/jitterphysics2/blob/main/src/Jitter2/World.cs#L228). This should all be made consistent and consistent with the docs. I will take a look.

@RonenNess Should be fixed now.