chore: Removed System Using

This commit is contained in:
Syntriax 2024-01-26 12:40:12 +03:00
parent 8ebde9dedf
commit dfcc877e58
1 changed files with 6 additions and 7 deletions

View File

@ -1,4 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
@ -9,7 +8,7 @@ namespace Syntriax.Engine.Physics2D.Primitives;
public record Shape(IList<Vector2D> Vertices) : IEnumerable<Vector2D>
{
public Vector2D this[Index index] => Vertices[index];
public Vector2D this[System.Index index] => Vertices[index];
public static Shape CreateCopy(Shape shape) => new(new List<Vector2D>(shape.Vertices));
@ -20,15 +19,15 @@ public record Shape(IList<Vector2D> Vertices) : IEnumerable<Vector2D>
foreach (Vector2D point in shape.Vertices)
{
minX = MathF.Min(minX, point.X);
minY = MathF.Min(minY, point.Y);
maxX = MathF.Max(maxX, point.X);
maxY = MathF.Max(maxY, point.Y);
minX = Math.Min(minX, point.X);
minY = Math.Min(minY, point.Y);
maxX = Math.Max(maxX, point.X);
maxY = Math.Max(maxY, point.Y);
}
float dx = maxX - minX;
float dy = maxY - minY;
float deltaMax = MathF.Max(dx, dy);
float deltaMax = Math.Max(dx, dy);
float midX = (minX + maxX) / 2;
float midY = (minY + maxY) / 2;