From a881f6313a28014cb89a088e19a49136d36aa9c8 Mon Sep 17 00:00:00 2001 From: Denis Olshin Date: Fri, 7 Sep 2018 09:57:55 +0300 Subject: [PATCH] fixed not resetting body force and torque in velocity_func https://github.com/viblo/pymunk/blob/master/chipmunk_src/src/cpBody.c#L505 --- lib/cpBody.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/cpBody.js b/lib/cpBody.js index 74c0748..62d0d05 100644 --- a/lib/cpBody.js +++ b/lib/cpBody.js @@ -260,6 +260,9 @@ Body.prototype.velocity_func = function(gravity, damping, dt) this.w = clamp(this.w*damping + this.t*this.i_inv*dt, -w_limit, w_limit); this.sanityCheck(); + + this.f = new Vect(0,0); + this.t = 0; }; Body.prototype.position_func = function(dt)