Code: Select all
// Apply normal + friction impulse
/* */Vec2 P = c->Pn * c->normal + c->Pt * tangent;
body1->velocity -= body1->invMass * P;
body1->angularVelocity -= body1->invI * Cross(r1, P);
body2->velocity += body2->invMass * P;
body2->angularVelocity += body2->invI * Cross(r2, P);
Why this code is matter?
As i understand impulses already applied and body velocities modified while performing Impulse iteration.