-
Notifications
You must be signed in to change notification settings - Fork 27
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
Shape Collision data ordering #41
Shape Collision data ordering #41
Conversation
The build failure here appears to be in completely unrelated heaps code:
It doesn't seem like anything related to my code changes. Is this something that's happened before for PRs against this repo? |
I think something in heaps changed. I noticed the workflow is just using Here is the worfklow run passing using that version of heaps I made a PR to propose these changes to the repo here, if this is desirable. |
Does this still need to be reverted? Glad to help out if there are other issues outside of the ones related to the other PR. (also, welcome back!) |
😂 OK, that seems problematic. I'll take a look at the samples and try to come at my fix again. I'm a bit surprised that sort of behavior came out of my change, not gunna lie. I'll put up a new PR if I figure things out. |
could you add a sample here that reproduces the issue you're seeing btw? i wouldnt mind looking over the issue |
I meant to do that originally, but was using a game jam I was participating at the time as my test bed. Let me see if I can put together a minimal example to show the problem. |
@AustinEast I made an example as a state in my fork here: https://github.com/MondayHopscotch/echo/tree/listener-shape-issue I'm just tracing out the shapes as passed to the listener func and comparing them with the data. Note that the data doesn't match the shapes. More specifically, the This PR was attempting to set the flip flags correctly, but I clearly missed something. It looks like the problem manifests itself slightly differently for squares/polygons/circles. I'll keep tinkering and try to get to the bottom of it. |
I've pushed up another commit that gets things half way to working (at least based on the samples). I fixed the data shape portion of it, and the physics craziness seems to be isolated to circles now. States without circles behave correctly. In that branch I also changed the optimized statics state to use static rects instead to test my theory. Getting closer. It looks like it's just a matter of the normals being wrong at this point (inverted from what is correct, resulting in a collision resolution that keeps throwing the shapes back and forth). |
@AustinEast I put up a draft PR from my branch that appears to have fixed the issues we saw in the sample states here: #45 Per the description in the PR, I pushed up my other 2 states along with at least one |
I have run into a bug the previous two game jams I've participated in where the
Array<CollisionData>
passed into the listener callbacks was flipped from the order thata
andb
are passed in. More concretely, this is happening:This PR fixes ordering of shape collision data so listener data matches order of bodies by properly passing the
flip
value through the variouscollide*
functions.