Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RevoluteJoint.prototype.getReactionForce returns NaN? #52

Closed
jazzyjeff5 opened this issue Apr 11, 2018 · 2 comments
Closed

RevoluteJoint.prototype.getReactionForce returns NaN? #52

jazzyjeff5 opened this issue Apr 11, 2018 · 2 comments

Comments

@jazzyjeff5
Copy link

jazzyjeff5 commented Apr 11, 2018

Hey,

Trying to get the reaction force and torque out of a joint to determine if I should remove the joint (creating "breakable" joints).

I'm not sure if this code in Planck is correct:

RevoluteJoint.prototype.getReactionForce = function(inv_dt) {
var P = Vec2.neo(this.m_impulse.x, this.m_impulse.y);
return inv_dt * P;
};

P is an object with x and y properties, and then the object is multiplied by a number? This returns NaN. Should it be p.mul(inv_dt) instead so the multiplication works correctly?

Thanks!

@shakiba
Copy link
Collaborator

shakiba commented Apr 12, 2018

Probably Vec2.mul(inv_dt, this.m_impuls).

@shakiba
Copy link
Collaborator

shakiba commented Jul 24, 2018

This is fixed in last release.

@shakiba shakiba closed this as completed Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants