Esempio n. 1
0
        private void RegisterFixture()
        {
            // Reserve proxy space
            Proxies    = new FixtureProxy[Shape.ChildCount];
            ProxyCount = 0;

            if (Body.Enabled)
            {
                IBroadPhase broadPhase = Body._world.ContactManager.BroadPhase;
                CreateProxies(broadPhase, ref Body._xf);
            }

            Body.FixtureList.Add(this);

            // Adjust mass properties if needed.
            if (Shape._density > 0.0f)
            {
                Body.ResetMassData();
            }

            // Let the world know we have a new fixture. This will cause new contacts
            // to be created at the beginning of the next time step.
            Body._world._worldHasNewFixture = true;

            if (Body._world.FixtureAdded != null)
            {
                Body._world.FixtureAdded(this);
            }
        }