Closed cshyeon closed 6 years ago
Is it possible to do this a little different? I assume the list of collisions is very small. So at the beginning of detect()
, simply go over all the collisions, and if either id1
or id2
are not in Object.keys(objects)
then delete that collision.
I feel as if this might not be an ideal architecture. Emitting so many collisionStay
events will actually degrade performance with the overhead involved in emitting them for every collision on every game step. The majority of the time you're not actually using these, so it makes more sense to actively query only the colliding pairs you do care about.
Thanks, code about Memory leak was modified according to namel's opinion and removed the "collisionStay" event temporarily. Also, PR title was edited.
Thanks !
Hi, I added 'collisionStay' event to BruteCollisionDetection.js This will help to identify whether or not to remain in collision.