Exemple #1
0
 /// <summary>
 /// Creates the Gate object between two planets
 /// </summary>
 /// <param name="texture">Gate Texture</param>
 /// <param name="points">Points defining the position of the gate</param>
 /// <param name="scale">The scale of the world (use the default)</param>
 /// <param name="p1">The first planet anchor of this gate</param>
 /// <param name="p2">The second planet anchor of this gate</param>
 public Gate(Texture2D texture, Vector2 pos, Vector2 dimension, PlanetaryObject p1, PlanetaryObject p2, Vector2 angleVector) :
     base(texture, pos, dimension)
 {
     planet1  = p1;
     planet2  = p2;
     Rotation = (float)Math.Atan2(angleVector.X, -angleVector.Y);
 }
Exemple #2
0
 public Gate(Texture2D texture, PlanetaryObject p1, PlanetaryObject p2) :
     this(texture, ((p1.Position - p2.Position) / 2.0f) + p2.Position, new Vector2(1.0f, (p1.Position - p2.Position).Length()), p1, p2, (p2.Position - p1.Position))
 {
 }