b2Body.prototype.ApplyLinearImpulseToCenter = function (impulse, wake) {
if (wake === void 0) { wake = true; }
if (this.m_type !== exports.b2BodyType.b2_dynamicBody) {
return;
}
if (wake && !this.m_awakeFlag) {
this.SetAwake(true);
}
// Don't accumulate a force if the body is sleeping.
if (this.m_awakeFlag) {
this.m_linearVelocity.x += this.m_invMass * impulse.x;
this.m_linearVelocity.y += this.m_invMass * impulse.y;
}
};
b2Body.prototype.ApplyLinearImpulse = function (impulse, point, wake) {
if (wake === void 0) { wake = true; }
if (this.m_type !== exports.b2BodyType.b2_dynamicBody) {
return;
}
if (wake && !this.m_awakeFlag) {
this.SetAwake(true);
}
// Don't accumulate a force if the body is sleeping.
if (this.m_awakeFlag) {
this.m_linearVelocity.x += this.m_invMass * impulse.x;
this.m_linearVelocity.y += this.m_invMass * impulse.y;
this.m_angularVelocity += this.m_invI * ((point.x - this.m_sweep.c.x) * impulse.y - (point.y - this.m_sweep.c.y) * impulse.x);
}
};