Example #1
0
        private void Report(ContactVelocityConstraint[] constraints)
        {
            if (_contactManager == null)
            {
                return;
            }

            for (int i = 0; i < ContactCount; ++i)
            {
                Contact c = _contacts[i];

                if (c.FixtureA.AfterCollision != null)
                {
                    c.FixtureA.AfterCollision(c.FixtureA, c.FixtureB, c);
                }

                if (c.FixtureB.AfterCollision != null)
                {
                    c.FixtureB.AfterCollision(c.FixtureB, c.FixtureA, c);
                }

                if (_contactManager.PostSolve != null)
                {
                    ContactVelocityConstraint cc = constraints[i];

                    _contactManager.PostSolve(c, cc);
                }
            }
        }
Example #2
0
        private void Report(ContactVelocityConstraint[] constraints)
        {
            if (_contactManager == null)
            {
                return;
            }

            for (int i = 0; i < ContactCount; ++i)
            {
                Contact c = _contacts[i];

                //FPE optimization: We don't store the impulses and send it to the delegate. We just send the whole contact.
                //FPE feature: added after collision
                if (c.FixtureA.AfterCollision != null)
                {
                    c.FixtureA.AfterCollision(c.FixtureA, c.FixtureB, c, constraints[i]);
                }

                if (c.FixtureB.AfterCollision != null)
                {
                    c.FixtureB.AfterCollision(c.FixtureB, c.FixtureA, c, constraints[i]);
                }

                if (_contactManager.PostSolve != null)
                {
                    _contactManager.PostSolve(c, constraints[i]);
                }
            }
        }
Example #3
0
        private void Report(ContactConstraint[] constraints)
        {
            if (_contactManager == null)
            {
                return;
            }

            for (int i = 0; i < ContactCount; ++i)
            {
                Contact c = _contacts[i];

                ContactConstraint cc = constraints[i];

                ContactImpulse impulse = new ContactImpulse();
                for (int j = 0; j < cc.PointCount; ++j)
                {
                    impulse.NormalImpulses[j]  = cc.Points[j].NormalImpulse;
                    impulse.TangentImpulses[j] = cc.Points[j].TangentImpulse;
                }

                _contactManager.PostSolve(c, ref impulse);
            }
        }
Example #4
0
        private void Report(ContactConstraint[] constraints)
        {
            if (_contactManager == null)
            {
                return;
            }

            for (int i = 0; i < ContactCount; ++i)
            {
                Contact c = _contacts[i];

                c.FixtureA.Body.OnAfterCollision(c.FixtureA, c.FixtureB, c);
                c.FixtureB.Body.OnAfterCollision(c.FixtureB, c.FixtureA, c);

                ContactConstraint cc = constraints[i];
                c.FixtureA.Body.OnPostSolve(c, cc);
                c.FixtureB.Body.OnPostSolve(c, cc);

                if (_contactManager.PostSolve != null)
                {
                    _contactManager.PostSolve(c, cc);
                }
            }
        }