Project290.Physics.Dynamics.Body.SetTransformIgnoreContacts C# (CSharp) Method

SetTransformIgnoreContacts() public method

For teleporting a body without considering new contacts immediately.
public SetTransformIgnoreContacts ( Vector2 &position, float angle ) : void
position Vector2 The position.
angle float The angle.
return void
        public void SetTransformIgnoreContacts(ref Vector2 position, float angle)
        {
            Xf.R.Set(angle);
            Xf.Position = position;

            Sweep.C0 =
                Sweep.C =
                new Vector2(Xf.Position.X + Xf.R.Col1.X*Sweep.LocalCenter.X + Xf.R.Col2.X*Sweep.LocalCenter.Y,
                            Xf.Position.Y + Xf.R.Col1.Y*Sweep.LocalCenter.X + Xf.R.Col2.Y*Sweep.LocalCenter.Y);
            Sweep.A0 = Sweep.A = angle;

            BroadPhase broadPhase = World.ContactManager.BroadPhase;
            for (int i = 0; i < FixtureList.Count; i++)
            {
                FixtureList[i].Synchronize(broadPhase, ref Xf, ref Xf);
            }
        }