API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceContactModifierContext

@codexo/exojs-physics / physics / stable

A solid contact as the world's ContactModifier sees it: the pair that produced it, the contact normal, and the three per-step controls the modifier may change. Everything else is read-only. The object is reused for every contact and is only valid for the duration of the callback - read what you need, write the controls, do not retain it. Writing a control affects this step only; the values are re-derived from the two colliders before the modifier runs again. A chain collider is solved per edge, so a body touching several edges of one chain reaches the modifier once per edge, each time with the same authored collider pair. Decide from the contact's own normal and penetration rather than from the pair's identity if that distinction matters.

11
props
0
methods
0
events
Import
import { ContactModifierContext } from '@codexo/exojs-physics'

A solid contact as the world's ContactModifier sees it: the pair that produced it, the contact normal, and the three per-step controls the modifier may change. Everything else is read-only.

The object is reused for every contact and is only valid for the duration of the callback - read what you need, write the controls, do not retain it.

Writing a control affects this step only; the values are re-derived from the two colliders before the modifier runs again.

A chain collider is solved per edge, so a body touching several edges of one chain reaches the modifier once per edge, each time with the same authored collider pair. Decide from the contact's own normal and penetration rather than from the pair's identity if that distinction matters.

Properties11
enabled: boolean
Set to false to skip this contact in the solver for this step. The contact stays geometrically touching, so collisionStart/collisionEnd still describe the real geometry; it just applies no impulse, and it does not join the two bodies into one sleeping island. Its warm-start impulses are dropped while it is disabled, so re-enabling it starts cold rather than releasing a stale impulse.
friction: number
Coulomb friction for this step. Defaults to √(a.friction × b.friction) over the two colliders.
maxPenetration: number
Deepest penetration across the manifold points, in px.
normalX: number
X of the unit contact normal, pointing from A towards B.
normalY: number
Y of the unit contact normal, pointing from A towards B.
pointCount: number
Manifold points backing this contact: 1 for a vertex/face hit, 2 for a face/face hit.
restitution: number
Restitution for this step. Defaults to max(a.restitution, b.restitution) over the two colliders.
Source