public Contact PopContact(Fixture fixtureA, int indexA, Fixture fixtureB, int indexB)
{
ShapeType type1 = fixtureA.Type;
ShapeType type2 = fixtureB.Type;
ContactRegister reg = contactStacks[(int)type1][(int)type2];
IDynamicStack<Contact> creator = reg.Creator;
if (creator != null)
{
if (reg.Primary)
{
Contact c = creator.Pop();
c.Init(fixtureA, indexA, fixtureB, indexB);
return c;
}
else
{
Contact c = creator.Pop();
c.Init(fixtureB, indexB, fixtureA, indexA);
return c;
}
}
return null;
}