Live alias of the collision mask bits.
Live alias of the collision category bit.
Apply a continuous force (integrated over the next step). When the
optional application point is provided and differs from the body's
centroid, a corresponding torque is generated:
τ = r × F, where r = point - centroid. BuiltinAdapter routes the
torque into applyTorque; MatterAdapter passes the point
directly to Matter.Body.applyForce.
force X component
force Y component
OptionalpointX: numberworld X of the application point (defaults to centroid)
OptionalpointY: numberworld Y of the application point (defaults to centroid)
// pure linear thrust (existing 2-arg form, unchanged):
ship.body.applyForce(0, -0.05);
// off-centre kick: pushes the crate to the right AND tips it over,
// because the contact point is at the top of the crate, away from
// its centroid:
const topX = crate.pos.x + crate.width / 2;
const topY = crate.pos.y;
crate.body.applyForce(1.5, 0, topX, topY);
Apply an instantaneous impulse (Δv = J / mass).
OptionalapplyApply an angular impulse directly: Δω = τ / pseudoInertia. Bypasses
the force/lever-arm computation in applyForce for the case
where you want to spin something up without applying a linear force —
a thruster, a power-up's intrinsic rotation, a knockback spin effect.
OptionalgetRead absolute rotation angle (radians).
OptionalgetOptionalsetSet absolute rotation angle (radians). Re-syncs the renderable's
currentTransform immediately — no need to wait for the next
physics step. Useful when you want to point a body at a target.
OptionalsetSet angular velocity (rad / frame). BuiltinAdapter integrates this
each step into the body's angle and updates the renderable's
currentTransform (visual rotation only — SAT collisions remain
axis-aligned). MatterAdapter routes to Matter.Body.setAngularVelocity,
which participates fully in matter's rotational dynamics.
OptionalsetSet restitution / bounciness.
OptionalsetSet the collision category bit for this body.
OptionalsetSet per-body gravity multiplier.
OptionalsetSet mass directly (recomputes inertia where applicable).
OptionalsetToggle sensor mode (fires collision events without push-out).
OptionalisSensor: booleanToggle static (fixed-position, infinite-mass) state. Static bodies still participate in collisions; they just don't integrate.
OptionalisStatic: booleanSet linear velocity in viewport pixels per frame.
Portable physics body handle returned by PhysicsAdapter.addBody and stored on
renderable.body. Every adapter guarantees these methods so engine-portable code can read and mutate body state without knowing which adapter is active.Each adapter exports a concrete
Bodytype (e.g.MatterAdapter.Body,BuiltinAdapter.Body) that extends this interface with its native fields — cast to the adapter-specific type only when reaching for engine-specific state (Matter'sfrictionAir, BuiltinAdapter'svel/force, etc.).Methods marked optional are not implemented by every adapter; check the adapter docs or fall back to the equivalent on the adapter itself (e.g.
adapter.setVelocity(r, v)always works).