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