Esempio n. 1
0
        private bool SequenceEqual <T>(FarseerPhysics.Common.HashSet <T> first, FarseerPhysics.Common.HashSet <T> second)
        {
            if (first.Count != second.Count)
            {
                return(false);
            }

            using (IEnumerator <T> enumerator1 = first.GetEnumerator())
            {
                using (IEnumerator <T> enumerator2 = second.GetEnumerator())
                {
                    while (enumerator1.MoveNext())
                    {
                        if (!enumerator2.MoveNext() || !Equals(enumerator1.Current, enumerator2.Current))
                        {
                            return(false);
                        }
                    }

                    if (enumerator2.MoveNext())
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Esempio n. 2
0
        internal Fixture()
        {
            FixtureId = _fixtureIdCounter++;

            _collisionCategories = Settings.DefaultFixtureCollisionCategories;
            _collidesWith        = Settings.DefaultFixtureCollidesWith;
            _collisionGroup      = 0;
            _collisionIgnores    = new FarseerPhysics.Common.HashSet <int>();

            IgnoreCCDWith = Settings.DefaultFixtureIgnoreCCDWith;

            //Fixture defaults
            Friction    = 0.2f;
            Restitution = 0;
        }