protected virtual void SustainArc() { if (arc == null) { arc = new BezierElectricArc(20); arc.Spawn(Map); } var basePos = DrawPos.WorldToFlat(); arc.P0 = basePos + new Vector2(0, 1.479f); arc.P3 = basePos + new Vector2(ForgeCellIndex == 0 ? 1.524f : -1.524f, 1.633f); arc.P1 = Vector2.Lerp(arc.P0, arc.P3, 0.3f) + new Vector2(0f, 0.65f); arc.P2 = Vector2.Lerp(arc.P0, arc.P3, 0.7f) + new Vector2(0f, 0.65f); arc.Amplitude = new Vector2(0, 0.28f); }
public override Vector2 GetFlatConnectionPoint() { // NESW are 0123 Vector2 root = DrawPos.WorldToFlat(); switch (Rotation.AsInt) { case 0: return(root + new Vector2(0, 0.6f)); case 1: return(root + new Vector2(0.508f, 0.028f)); case 2: return(root + new Vector2(0, -0.421f)); case 3: return(root + new Vector2(-0.508f, 0.028f)); } return(root); }