Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Init the data structures relevant for collision calculations when the…
… body is added, rather than on the fly If a body is deleted before it can be the body0 of a collision, an entry for it won't be created in the collisionKeys array. However, because of the splice idiom used at removal, when a body that has no entry in collisionKeys is deleted, an arbitrary entry will be deleted regardless. Eventually, when further bodys are removed according to this pattern, there may be no entry in collisionKeys at all, which will prevent the collisions map from ever being emptied. This can completely prevent the firing of collisionstart events.
- Loading branch information