Esempio n. 1
0
 public void ConnectedBraces(SC.List <Brace> connected)
 {
     if (!connected.Contains(this))
     {
         connected.Add(this);
         foreach (Connector connector in connectors)
         {
             connector.a.ConnectedBraces(connected);
             connector.b.ConnectedBraces(connected);
         }
     }
 }
Esempio n. 2
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();
    }