liabru / matter-js

a 2D rigid body physics engine for the web ▲● ■

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Body.create` ignores `anglePrev`, `area`, `mass` and `inertia` when they are 0.

wilcooo opened this issue · comments

commented

In Body._initProperties (a subroutine of Body.create), the anglePrev is set to: body.anglePrev || body.angle.
This means that when an anglePrev of zero is given, it is ignored.

The same is true for area, mass and inertia, but this is slightly less important since those values are generally positive.

Possible fix

use ?? instead of ||