Ejemplo n.º 1
0
 public static FRectangle CreateByCenter(FPoint pos, float w, float h)
 {
     return(new FRectangle(pos.X - w / 2, pos.Y - h / 2, w, h));
 }
Ejemplo n.º 2
0
 public static FRectangle CreateByCenter(FPoint origin, float cx, float cy, float width, float height)
 {
     return(new FRectangle(origin.X + cx - width / 2, origin.Y + cy - height / 2, width, height));
 }
Ejemplo n.º 3
0
 public static FRectangle CreateByCenter(FPoint pos, FSize size)
 {
     return(new FRectangle(pos.X - size.Width / 2, pos.Y - size.Height / 2, size.Width, size.Height));
 }
Ejemplo n.º 4
0
 public FRectangle AsCenteredTo(FPoint center)
 {
     return(new FRectangle(center.X - Width / 2, center.Y - Height / 2, Width, Height));
 }
Ejemplo n.º 5
0
 public FRectangle AsRotateCenterAround(FPoint center, float rot)
 {
     return(CreateByCenter(Center.RotateAround(center, rot), Width, Height));
 }
Ejemplo n.º 6
0
 public FRectangle AsScaledAndTranslated(float scale, FPoint offset)
 {
     return(new FRectangle(X * scale + offset.X, Y * scale + offset.Y, Width * scale, Height * scale));
 }
Ejemplo n.º 7
0
 public bool Contains(FPoint p, float delta)
 {
     return((X - p.X) * (X - p.X) + (Y - p.Y) * (Y - p.Y) <= (Radius + delta) * (Radius + delta));
 }
Ejemplo n.º 8
0
 public bool Contains(FPoint p)
 {
     return((X - p.X) * (X - p.X) + (Y - p.Y) * (Y - p.Y) <= Radius * Radius);
 }
Ejemplo n.º 9
0
 public FCircle(FPoint location, float radius)
 {
     X      = location.X;
     Y      = location.Y;
     Radius = radius;
 }
Ejemplo n.º 10
0
 public static FSize Diff(FPoint a, FPoint b)
 {
     return(new FSize(FloatMath.Abs(a.X - b.X), FloatMath.Abs(a.Y - b.Y)));
 }