matter-js
matter-js copied to clipboard
Object on chain rotation
Hey,
Take a look at the following example: https://codepen.io/MarioD/pen/53f84775d38a14e3ea506ca096fd3eb3
You will notice that the object at the end of the chain on the right hand side behaves very strangely. Pull around on it using the mouse and watch how it floats/rotates.
However, if you set the density to something very very small:
var rect1 = Bodies.rectangle(800, 500, 160, 20, {density: 0.000001});
You will see that it fixes this issue.
Why does that fix this issue? And if you wanted a higher density on the object, how would you go about it?