crashcat docs
    Preparing search index...

    Type Alias Contacts

    contacts state

    type Contacts = {
        contacts: Contact[];
        contactsFreeIndices: number[];
        frameStamp: number;
        pendingContactRemoved: number[];
        readIdx: 0 | 1;
    }
    Index

    Properties

    contacts: Contact[]

    packed array of all contacts (active + free)

    contactsFreeIndices: number[]

    free list of available contact indices (indices to reuse)

    frameStamp: number

    Monotonic per-step frame counter, incremented once at the top of updateWorld. A contact is fresh this step iff its lastProcessedFrame === frameStamp; the per-pair stale reconcile uses this instead of a per-step "unprocessed" reset walk over every contact.

    pendingContactRemoved: number[]

    Deferred onContactRemoved event payloads, flat quads [bodyIdA, bodyIdB, subShapeIdA, subShapeIdB, ...].

    Removing a body destroys its contacts immediately, but the contact listener is an updateWorld argument — so the removal events are queued here as plain ids and fired at the start of the next updateWorld (matching jolt: "you'll receive an OnContactRemoved callback in the update after the body has been removed").

    readIdx: 0 | 1

    Index of the manifold buffer that holds the PREVIOUS step's cached data (read side this step).

    Flip once per step (after solver + storeAppliedImpulses) so that this step's writes become next step's reads. The other buffer (1 - readIdx) is the WRITE side this step.