This issue serves as a report about a potential bug in the function cp.Body.applyForce. I believe that it is mis-implemented as the function cp.Body.applyForce.
According to Chipmunk documentations, this function applys force $$F$$ to the body, in time $$dt$$. It should be
f=F(t)
However, in line 1767, cp.js, the function is implemented as
This leads to add $$F(t)$$ cumulatively in every $$dt$$, thus calculating the integration of $F$ over time domain, and that is essentially calculating impulse of the force from the beginning to now
This issue serves as a report about a potential bug in the function
cp.Body.applyForce
. I believe that it is mis-implemented as the functioncp.Body.applyForce
.According to Chipmunk documentations, this function applys force $$
F
$$ to the body, in time $$dt
$$. It should beHowever, in
line 1767, cp.js
, the function is implemented asThis leads to add $$
F(t)
$$ cumulatively in every $$dt
$$, thus calculating the integration of $F
$ over time domain, and that is essentially calculating impulse of the force from the beginning to nowTo apply force, the code should be
I hope the team could check and fix this bug. Thanks for your attention.