Why shouldn't I use pixels as unit with Box2D?

box2d, physics, simulation

Solution

Box2D is a simulation framework which internally uses the MKS system of units. If you want a reliable and predictable simulation, you should express the simulation systems you create in reasonable values within this system of units. You want a box to behave like a box, a rock to behave like a rock and a ball to behave like a ball.

If you take pixels as a unit and you have a box of 20 by 20 pixels with a scalar mass value of 10, you really create a box with sides of 20 meters long, which has a mass of a mere 10 kilograms. In essence, your simulation becomes difficult to set up and be made to behave realistically.

There is nothing stopping you from using pixels as units. But for it to behave reliably, naturally and predictably, it is better and easier to express the values fed to the simulation framework in the units it expects and within reasonable boundaries.

Problem

In the manual it says that I should use small units (0.1-10 meters). It's discouraged to use pixels as the unit of measure. But why would Box2D be working better, and have better simulation than when I'd use small units?

Original source