Пример #1
0
 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);
 }
Пример #2
0
 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));
     }
 }
Пример #3
0
 public Plane(Vector c1, Vector c2, Vector c3, Vector c4)
 {
 }
Пример #4
0
 /// <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);
 }
Пример #5
0
 /// <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
 }