public override void PostSolve(Contact contact, ContactImpulse impulse) { }
void PostSolveInternal(IntPtr contact, ContactImpulse impulse) { PostSolve(Contact.FromPtr(contact), impulse); }
public abstract void PostSolve(Contact contact, ContactImpulse impulse);
public override void PostSolve(Contact contact, ContactImpulse impulse) { foreach (var x in m_breaks) { if (_jointsToRemove.Contains(x) || x.MaxForce == 0) { // The body already broke. continue; } bool hasAnyFixtures = false; foreach (var f in x.Joint.BodyA.Fixtures) { if (f == contact.FixtureA || f == contact.FixtureB) { hasAnyFixtures = true; break; } } if (!hasAnyFixtures) { foreach (var f in x.Joint.BodyB.Fixtures) { if (f == contact.FixtureA || f == contact.FixtureB) { hasAnyFixtures = true; break; } } if (!hasAnyFixtures) continue; } // Should the body break? int count = contact.Manifold.PointCount; float maxImpulse = 0.0f; for (int i = 0; i < count; ++i) maxImpulse = Math.Max(maxImpulse, impulse.GetNormalImpulse(i)); if (maxImpulse > x.MaxForce) { // Flag the body for breaking. _jointsToRemove.Add(x); } } }