Box2D.Dynamics.World.PopContact C# (CSharp) Method

PopContact() public method

public PopContact ( Fixture fixtureA, int indexA, Fixture fixtureB, int indexB ) : Contact
fixtureA Fixture
indexA int
fixtureB Fixture
indexB int
return Box2D.Dynamics.Contacts.Contact
        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;
        }