Exemplo n.º 1
0
    public void newSumAnchor(SC.List <Brace> braces, Anchor preAnchor)
    {
        Anchor anchor = newAnchor(ToLocal(braces[0].GlobalPosition));

        anchor.GlobalPosition = preAnchor.GlobalPosition;
        anchor.Rotation       = preAnchor.Rotation;
        anchor.SetAngularVelocity(preAnchor.GetAngularVelocity());
        anchor.SetLinearVelocity(preAnchor.GetLinearVelocity());
        anchors.Add(anchor);
        foreach (Brace brace in braces)
        {
            anchor.addBraceToList(brace);
            brace.anchor = anchor;
            brace.GetParent().RemoveChild(brace);
            anchor.AddChild(brace);
            brace.updateConnection();
        }
        anchor.braces[0].remove();
        anchor.setActive(true);
        anchor.CenterGravity();
    }