Beispiel #1
0
        internal void SynchronizeFixtures()
        {
            Transform xf1 = new Transform();

            xf1.R.Set(_sweep.a0);
            xf1.Position = _sweep.c0 - MathUtils.Multiply(ref xf1.R, _sweep.localCenter);

            BroadPhase broadPhase = _world._contactManager._broadPhase;

            for (Fixture f = _fixtureList; f != null; f = f._next)
            {
                f.Synchronize(broadPhase, ref xf1, ref _xf);
            }
        }
Beispiel #2
0
        // For teleporting a body without considering new contacts immediately.
        public void SetTransformIgnoreContacts(Vector2 position, float angle)
        {
            Debug.Assert(_world.IsLocked == false);
            if (_world.IsLocked == true)
            {
                return;
            }

            _xf.R.Set(angle);
            _xf.Position = position;

            _sweep.c0 = _sweep.c = MathUtils.Multiply(ref _xf, _sweep.localCenter);
            _sweep.a0 = _sweep.a = angle;

            BroadPhase broadPhase = _world._contactManager._broadPhase;

            for (Fixture f = _fixtureList; f != null; f = f._next)
            {
                f.Synchronize(broadPhase, ref _xf, ref _xf);
            }
        }