piqnt / planck.js

2D JavaScript Physics Engine
http://piqnt.com/planck.js/
MIT License
4.88k stars 236 forks source link

getGravity bug #182

Open bobcgausa opened 3 years ago

bobcgausa commented 3 years ago

As the following iforce custom gravity tutorial example shows getGravity().neg() actually inverts gravity because getGravity does not clone the vector

https://editor.p5js.org/Bobcook47/sketches/ITP2X7D-g

Toby222 commented 3 years ago

This is normal behavior, in line with how Box2D does it

cf. box2d source