OptionalgravityWorld gravity in pixels per second² (matches melonJS pixel-space
convention). Default {x: 0, y: 320} ≈ 10 m/s² at
pixelsPerMeter = 32 — Earth-like gravity pulling down.
Internally translated to meters by dividing by pixelsPerMeter before being applied to the planck world.
OptionalpixelsPlanck is a Box2D port and operates in meters internally; the
adapter converts to/from melonJS's pixel-space at every boundary
(positions, velocities, gravity, forces). Default 32 — i.e. one
32×32 sprite is one Box2D unit, which falls inside Box2D's tuned
sweet spot (0.1 – 10 m).
Bumping this makes the world feel "smaller" (objects act heavier); lowering makes everything feel "bigger" (and risks stability issues if bodies grow past Box2D's tuned scale).
OptionalpositionOptionalsubNumber of physics substeps per engine frame. Each call to
PlanckAdapter.step runs world.step(dt / N) N times
instead of one full-dt step. Increases narrow-phase accuracy at
high relative velocities at the cost of ~N× physics CPU. Default
1. Values < 1 are clamped to 1.
OptionalvelocityBox2D solver iterations per step. The defaults are Box2D's
recommended values; bump position for stiffer stacks (less
jitter at the cost of CPU) or velocity for crisper restitution.
Options accepted by the PlanckAdapter constructor.