public override void PreSolve(Box2D.Dynamics.Contacts.b2Contact contact, ref Box2D.Collision.b2Manifold oldManifold) { b2Manifold manifold = contact.GetManifold(); if (manifold.pointCount == 0) { return; } b2Fixture fixtureA = contact.GetFixtureA(); b2Fixture fixtureB = contact.GetFixtureB(); b2PointState[] state1 = new b2PointState[b2Settings.b2_maxManifoldPoints]; b2PointState[] state2 = new b2PointState[b2Settings.b2_maxManifoldPoints]; b2Collision.b2GetPointStates(state1, state2, ref oldManifold, ref manifold); b2WorldManifold worldManifold = new b2WorldManifold(); contact.GetWorldManifold(ref worldManifold); for (int i = 0; i < manifold.pointCount && m_pointCount < k_maxContactPoints; ++i) { ContactPoint cp = m_points[m_pointCount]; cp.fixtureA = fixtureA; cp.fixtureB = fixtureB; cp.position = worldManifold.points[i]; cp.normal = worldManifold.normal; cp.state = state2[i]; m_points[m_pointCount] = cp; ++m_pointCount; } }