Skip to content

physicsCore

JoeStrout edited this page Nov 16, 2026 · 2 revisions

physicsCore

Name Parameters Purpose
updateGeometry shapes, verts, pos, bodyMask Transform shapes into world coordinates and compute their bounds, for the bodies whose row in bodyMask is nonzero (or all bodies, if bodyMask is null)
findPairs shapes, invMass, margin=0, pairs Find the pairs of shapes whose bounding boxes come within margin and that may collide; fills the pairs matrix and returns the number of pairs
solveContacts contacts, pos, vel, invMass, dt, iterations=10, biasFactor=0.2, slop=0.5, restThreshold=30 Solve contact impulses for one step, updating vel and the contacts' ColPn/ColPt in place
collidePairs pairs, shapes, verts, margin=0, prevContacts, contacts Collide shape pairs into the contacts matrix (one row per point), warm-started from prevContacts (or null); returns how many pairs are touching

Clone this wiki locally