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