internal void SynchronizeFixtures() { XForm xf1 = new XForm(); 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); } }
/// Set the position of the body's origin and rotation. /// This breaks any contacts and wakes the other bodies. /// @param position the world position of the body's local origin. /// @param angle the world rotation in radians. public void SetXForm(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); } _world._contactManager.FindNewContacts(); }