Esempio n. 1
0
 public UniformMotionSprite(
     Surface surface, Point2 startLocation, Vector2F velocity,
     float totalTime)
     : this(new StaticAnimation(surface), startLocation,
         startLocation + (Vector2)(velocity * totalTime),
         totalTime)
 {
 }
Esempio n. 2
0
 public Vector2F Rotate90(Vector2F pivot)
 {
     return Add(-pivot)
             .Rotate90()
             .Add(pivot);
 }
Esempio n. 3
0
 /// <summary>
 ///   内積を求める。
 /// </summary>
 /// <param name="v"> </param>
 /// <returns> </returns>
 public float InnerProduct(Vector2F v)
 {
     return X * v.X + Y * v.Y;
 }
Esempio n. 4
0
 public bool Equals(Vector2F v)
 {
     return v.X == X && v.Y == Y;
 }
Esempio n. 5
0
 /// <summary>
 ///   外積のZ成分(X, Y成分は0)を求める。
 /// </summary>
 /// <param name="v"> </param>
 /// <returns> </returns>
 public float CrossProduct(Vector2F v)
 {
     return X * v.Y - Y * v.X;
 }
Esempio n. 6
0
 public Vector2F Add(Vector2F dv)
 {
     return new Vector2F(X + dv.X, Y + dv.Y);
 }
Esempio n. 7
0
 public UniformMotionSprite(
     AnimationSurface animationSurface, Point2 startLocation,
     Vector2F velocity, float totalTime)
     : this(animationSurface, startLocation,
         startLocation + (Vector2)(velocity * totalTime),
         totalTime)
 {
 }
Esempio n. 8
0
 public Point2F Rotate270(Vector2F pivot)
 {
     return Add(-pivot)
             .Rotate270()
             .Add(pivot);
 }
Esempio n. 9
0
 public Point2F Add(Vector2F dv)
 {
     return new Point2F(X + dv.X, Y + dv.Y);
 }