What Info is in the planck.js EndContact Event?

In planck.js—a 2D physics engine for JavaScript games and simulations—the EndContact event is triggered immediately after two fixtures stop touching. This article provides a quick breakdown of the specific information you can extract from this event, including access to the underlying Contact object, the colliding fixtures, the parent bodies, and why contact state data like manifolds are no longer available at this stage of the collision lifecycle.

Accessing the Contact Object

When the EndContact event fires, the listener receives a Contact object as its primary argument. This object is the gateway to understanding which elements in your physics world have just separated.

world.on('end-contact', function(contact) {
    // Your extraction code here
});

Key Data Extracted from the Event

Limitations: What You Cannot Extract

It is equally important to know what information is not reliable during an EndContact event. Because the shapes are no longer intersecting, the engine clears the geometric collision data.