Documentation
    Preparing search index...

    Interface ContactPoint

    One point of contact inside a CollisionEvent (§29).

    §29 names ContactPoint[] without defining the element, so this is the engine's definition (decision, WP-5.1): the minimum a contact response, a debug overlay (§101 "debug data"), and an impact sound all need, and nothing an adapter would have to invent.

    All vectors are in world space. The vectors are live Vector3 instances owned by the event; treat them as read-only for the duration of the dispatch and copy anything you intend to keep — an adapter may pool contact records between steps.

    interface ContactPoint {
        impulse: number;
        normal: Vector3;
        pointOnA: Vector3;
        pointOnB: Vector3;
        separation: number;
    }
    Index
    impulse: number

    Magnitude of the normal impulse the solver applied at this point during the step, in newton-seconds. Zero for a speculative or sensor contact that carried no impulse.

    normal: Vector3

    Unit contact normal in world space, pointing from A towards B. Fixing the direction to the event's own A/B ordering is what makes it usable without knowing which collider the solver listed first.

    pointOnA: Vector3

    The contact point on collider A's surface, in world space.

    pointOnB: Vector3

    The contact point on collider B's surface, in world space.

    separation: number

    Signed distance along ContactPoint.normal between the two surfaces: negative while they interpenetrate, zero on touch, positive for a speculative contact that has not closed yet (§31).