-
Notifications
You must be signed in to change notification settings - Fork 2k
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
collisionStart firing multiple times #366
Comments
ah, never mind. I noticed that there is a unique pairID for collisions between two objects, so I can differentiate collisions based off that, I'm guessing? So are new collisionStarts just any time there is a collision between two objects with a new contact point? |
I've not yet had chance to look into this - did you resolve it or was it a misunderstanding? Collision start should only really fire once for each pair, until the body moves out of contact. |
Oh, sorry! I thought I was just misunderstanding how the collisions were supposed to work. So if a box lands on its corner (assuming 0 restitution), and then falls flat onto the ground, I'll reopen in case I'm misunderstanding my misunderstanding. |
Yeah it should fire once, then multiple |
Here were the examples I was testing with, I console.log the events. Only I get ~9-15 |
Thanks for this, will check it out. |
Hi! I faced the same issue. Are there any updates? The behaviour is the same as @dxu provided above. Although two bodies already started collision (in my case moving through each other), for some reason I receive several groups of (1 collisionStart, lots of collisionActive and 1 collisionEnd) events, but I assume it is expected as 1 group of these events. |
Hi! I faced the same issue. Are there any updates? |
Hi! I wrote up a small plugin for adding collision events to bodies, but I'm looking to use this elsewhere, and I'm noticing that the 'collisionStart' event is being fired a lot of times compared what I would expect is a single collision between two boxes.
You can run the example included in the repo, but essentially I have two squares,
BoxA
andBoxB
, falling onto the ground at different heights. I expected that there would be 3collisionStart
's (and 3 correspondingcollisionEnd
's), while there might be a bunch ofcollisionActive
's:BoxA
hits GroundBoxB
hitsBoxA
(BoxB
is aboveBoxA
)BoxB
falls over, hits Ground.But instead I get something along the lines of 10-20 collisionStarts and Ends.
Is this intentional / expected? Am I doing something wrong?
Thanks for the great work you've done with this engine! It's really awesome, and I'm looking forward to playing with it further!
The text was updated successfully, but these errors were encountered: