← Math Night

Rigid Body Physics

Configure shapes, bounciness, and gravity — then DROP. Watch the physics engine simulate collisions, friction, and tumbling in real time.

Physics Kernel edit before DROP
Loading editor…
Shape

What’s happening

Each shape is a rigid body — an object that doesn’t bend or deform. The physics engine tracks every body’s position, velocity, and rotation 60 times per second, computing exactly how forces like gravity and collision impulses change each one.

The kernel on the left controls four parameters:

ParameterWhat it does
restitutionHow elastic collisions are — 0 is clay, 1 is a perfect rubber ball
frictionHow much surfaces grip each other as they slide
densityMass per unit area — heavier objects carry more momentum
gravityScaleMultiplier on 9.8 m/s² — try 0.05 for asteroid-belt gravity

Things to try

Bouncy chaos — set restitution: 0.95 and friction: 0.0, choose Circle, and drop 40.

Moon landing — set gravityScale: 0.16 (the Moon is ⅙ of Earth’s gravity). Watch how much longer everything takes to settle.

Heavy vs. light — drop 15 bodies at density: 0.1, then Reset and drop 15 more at density: 4.0. Do they fall at different speeds? (They shouldn’t — but watch what happens when they collide.)

L-shapes only — the compound body has asymmetric mass distribution, so it tumbles unpredictably. Drop 30 with low friction and high bounciness.

Mix mode — check Mix to randomly assign shapes from the whole set. The varied moments of inertia make collisions much less predictable.

The L-shape

The L-shape is a compound body — one physics object made from two overlapping box fixtures. The engine computes the combined center of mass automatically, which sits closer to the heavy end. This offset means the L tumbles asymmetrically, never settling the same way twice.