schteppe / p2.js

JavaScript 2D physics library
Other
2.64k stars 330 forks source link

body mass = 0 vs body.KINEMATIC #135

Closed whitebyte closed 9 years ago

whitebyte commented 9 years ago

What is the right way to make kinematic body? mass = 0 seems to do the trick, but which method is more correct?

schteppe commented 9 years ago

Hi. Setting mass=0 only will make the body STATIC by default. You need to set both type and mass to get it properly kinematic. If you don't set KINEMATIC, the body won't move if you try setting the velocity of it.

whitebyte commented 9 years ago

Thx, a get it. Should read docs more carefully...