private Vector Transform(Vector v) { float a, r; r = v.Origin.Length(); a = Data.Arctan(v.Origin.Y, v.Origin.X); return new Vector(new Vector3(MULT * r * (float)Math.Cos(a), MULT * r * (float)Math.Sin(a), 0f), v.delta, color); }
private void UpdateVisual() { if (instant) { Vectors[1] = new Vector(Vectors[1].Origin, new Vector3(0f, height * (Ready ? 1 : time / RechargeTime), 0f), Ready ? ReadyColor : Color.Lerp(WaitingColor, ReadyColor, time / RechargeTime)); } else { Vectors[1] = new Vector(Vectors[1].Origin, new Vector3(0f, height * time / (Recharging ? RechargeTime : UseTime), 0f), Ready ? ReadyColor : Color.Lerp(WaitingColor, ReadyColor, time / RechargeTime)); } }
public Plane(Vector c1, Vector c2, Vector c3, Vector c4) { }
/// <summary> /// Make front and back vectors and take others from side planes /// </summary> private void MakeVectors(Vector3 position, Vector3 r, float i1, Plane previous, Plane next, float deltaY) { Vector prev = previous.v2; v1 = new Vector(position, r * i1, baseColor); v2 = next.v3; v3 = prev; v4 = new Vector(position + prev.delta, r * i1, baseColor); }
/// <summary> /// Make a plane with all vectors /// </summary> private void MakeVectors(Vector3 position, Vector3 r, Vector3 s, float i1, float i2, float deltaY) { v1 = new Vector(position, r * i1, baseColor); // front v2 = new Vector(position, s * i2 + Vector3.Up * deltaY, baseColor); // right v3 = new Vector(position + r * i1, s * i2 + Vector3.Up * deltaY, baseColor); // left v4 = new Vector(position + s * i2 + Vector3.Up * deltaY, r * i1, baseColor); // back }