Exemple #1
0
        /// Set the contact filtering data. This will not update contacts until the next time
        /// step when either parent body is active and awake.
        public void SetFilterData(ref Filter filter)
        {
            _filter = filter;

            if (_body == null)
            {
                return;
            }

            // Flag associated contacts for filtering.
            ContactEdge edge = _body.GetContactList();

            while (edge != null)
            {
                Contact contact  = edge.Contact;
                Fixture fixtureA = contact.GetFixtureA();
                Fixture fixtureB = contact.GetFixtureB();
                if (fixtureA == this || fixtureB == this)
                {
                    contact.FlagForFiltering();
                }

                edge = edge.Next;
            }
        }