diff --git a/Engine.Core/Primitives/ColorHSV.cs b/Engine.Core/Primitives/ColorHSV.cs index 7ad14d0..1e96467 100644 --- a/Engine.Core/Primitives/ColorHSV.cs +++ b/Engine.Core/Primitives/ColorHSV.cs @@ -1,5 +1,3 @@ -using System; - namespace Syntriax.Engine.Core; /// @@ -156,7 +154,7 @@ public readonly struct ColorHSV(float hue, float saturation, float value) /// Generates a hash code for the . /// /// A hash code for the . - public override int GetHashCode() => HashCode.Combine(Hue, Saturation, Value); + public override int GetHashCode() => System.HashCode.Combine(Hue, Saturation, Value); } /// diff --git a/Engine.Core/Primitives/ColorRGB.cs b/Engine.Core/Primitives/ColorRGB.cs index 89edd2a..46738ab 100644 --- a/Engine.Core/Primitives/ColorRGB.cs +++ b/Engine.Core/Primitives/ColorRGB.cs @@ -1,5 +1,3 @@ -using System; - namespace Syntriax.Engine.Core; /// @@ -138,7 +136,7 @@ public readonly struct ColorRGB(byte r, byte g, byte b) /// Generates a hash code for the . /// /// A hash code for the . - public override int GetHashCode() => HashCode.Combine(R, G, B); + public override int GetHashCode() => System.HashCode.Combine(R, G, B); } /// diff --git a/Engine.Core/Primitives/ColorRGBA.cs b/Engine.Core/Primitives/ColorRGBA.cs index bc5b35d..64dd128 100644 --- a/Engine.Core/Primitives/ColorRGBA.cs +++ b/Engine.Core/Primitives/ColorRGBA.cs @@ -1,5 +1,3 @@ -using System; - namespace Syntriax.Engine.Core; /// @@ -121,7 +119,7 @@ public readonly struct ColorRGBA(byte r, byte g, byte b, byte a = 255) /// Generates a hash code for the . /// /// A hash code for the . - public override int GetHashCode() => HashCode.Combine(R, G, B, A); + public override int GetHashCode() => System.HashCode.Combine(R, G, B, A); } /// diff --git a/Engine.Core/Primitives/Line2D.cs b/Engine.Core/Primitives/Line2D.cs index 83b6f8c..c89093a 100644 --- a/Engine.Core/Primitives/Line2D.cs +++ b/Engine.Core/Primitives/Line2D.cs @@ -1,4 +1,3 @@ -using System; using System.Diagnostics.CodeAnalysis; namespace Syntriax.Engine.Core; @@ -68,12 +67,12 @@ public readonly struct Line2D(Vector2D from, Vector2D to) /// public static float GetT(Line2D line, Vector2D point) { - float fromX = MathF.Abs(line.From.X); - float toX = MathF.Abs(line.To.X); - float pointX = MathF.Abs(point.X); + float fromX = Math.Abs(line.From.X); + float toX = Math.Abs(line.To.X); + float pointX = Math.Abs(point.X); - float min = MathF.Min(fromX, toX); - float max = MathF.Max(fromX, toX) - min; + float min = Math.Min(fromX, toX); + float max = Math.Max(fromX, toX) - min; pointX -= min; @@ -114,8 +113,8 @@ public readonly struct Line2D(Vector2D from, Vector2D to) /// public static bool OnSegment(Line2D line, Vector2D point) { - if (point.X <= MathF.Max(line.From.X, line.To.X) && point.X >= MathF.Min(line.From.X, line.To.X) && - point.Y <= MathF.Max(line.From.Y, line.To.Y) && point.Y >= MathF.Min(line.From.Y, line.To.Y)) + if (point.X <= Math.Max(line.From.X, line.To.X) && point.X >= Math.Min(line.From.X, line.To.X) && + point.Y <= Math.Max(line.From.Y, line.To.Y) && point.Y >= Math.Min(line.From.Y, line.To.Y)) return true; return false; @@ -173,7 +172,7 @@ public readonly struct Line2D(Vector2D from, Vector2D to) float t = (pointVector.X * edgeVector.X + pointVector.Y * edgeVector.Y) / (edgeVector.X * edgeVector.X + edgeVector.Y * edgeVector.Y); - t = MathF.Max(0, MathF.Min(1, t)); + t = Math.Max(0, Math.Min(1, t)); float closestX = line.From.X + t * edgeVector.X; float closestY = line.From.Y + t * edgeVector.Y; diff --git a/Engine.Core/Primitives/Quaternion.cs b/Engine.Core/Primitives/Quaternion.cs index 7a04539..75ab4f7 100644 --- a/Engine.Core/Primitives/Quaternion.cs +++ b/Engine.Core/Primitives/Quaternion.cs @@ -1,5 +1,3 @@ -using System; - namespace Syntriax.Engine.Core; /// @@ -178,11 +176,11 @@ public readonly struct Quaternion(float x, float y, float z, float w) if (dot > 0.9995f) return Lerp(from, to, t); - float angle = MathF.Acos(dot); - float sinAngle = MathF.Sin(angle); + float angle = Math.Acos(dot); + float sinAngle = Math.Sin(angle); - float fromWeight = MathF.Sin((1f - t) * angle) / sinAngle; - float toWeight = MathF.Sin(t * angle) / sinAngle; + float fromWeight = Math.Sin((1f - t) * angle) / sinAngle; + float toWeight = Math.Sin(t * angle) / sinAngle; return from * fromWeight + to * toWeight; } @@ -213,8 +211,8 @@ public readonly struct Quaternion(float x, float y, float z, float w) public static Quaternion FromAxisAngle(Vector3D axis, float angle) { float halfAngle = angle * .5f; - float sinHalf = MathF.Sin(halfAngle); - return new Quaternion(axis.X * sinHalf, axis.Y * sinHalf, axis.Z * sinHalf, MathF.Cos(halfAngle)); + float sinHalf = Math.Sin(halfAngle); + return new Quaternion(axis.X * sinHalf, axis.Y * sinHalf, axis.Z * sinHalf, Math.Cos(halfAngle)); } /// @@ -301,7 +299,7 @@ public readonly struct Quaternion(float x, float y, float z, float w) /// Generates a hash code for the . /// /// A hash code for the . - public override int GetHashCode() => HashCode.Combine(X, Y, Z); + public override int GetHashCode() => System.HashCode.Combine(X, Y, Z); } /// diff --git a/Engine.Core/Primitives/Triangle.cs b/Engine.Core/Primitives/Triangle.cs index e36ac03..aead0e3 100644 --- a/Engine.Core/Primitives/Triangle.cs +++ b/Engine.Core/Primitives/Triangle.cs @@ -1,5 +1,3 @@ -using System; - namespace Syntriax.Engine.Core; [System.Diagnostics.DebuggerDisplay("A: {A.ToString(), nq}, B: {B.ToString(), nq}, B: {C.ToString(), nq}")] @@ -10,7 +8,7 @@ public readonly struct Triangle(Vector2D A, Vector2D B, Vector2D C) public readonly Vector2D C { get; init; } = C; public readonly float Area - => .5f * MathF.Abs( + => .5f * Math.Abs( A.X * (B.Y - C.Y) + B.X * (C.Y - A.Y) + C.X * (A.Y - B.Y) @@ -25,7 +23,7 @@ public readonly struct Triangle(Vector2D A, Vector2D B, Vector2D C) float slopeBC = (triangle.C.Y - triangle.B.Y) / (triangle.C.X - triangle.B.X); Vector2D center; - if (MathF.Abs(slopeAB - slopeBC) > float.Epsilon) + if (Math.Abs(slopeAB - slopeBC) > float.Epsilon) { float x = (slopeAB * slopeBC * (triangle.A.Y - triangle.C.Y) + slopeBC * (triangle.A.X + triangle.B.X) - slopeAB * (triangle.B.X + triangle.C.X)) / (2f * (slopeBC - slopeAB)); float y = -(x - (triangle.A.X + triangle.B.X) / 2f) / slopeAB + (triangle.A.Y + triangle.B.Y) / 2f; diff --git a/Engine.Core/Primitives/Vector2D.cs b/Engine.Core/Primitives/Vector2D.cs index fa910a0..183c13f 100644 --- a/Engine.Core/Primitives/Vector2D.cs +++ b/Engine.Core/Primitives/Vector2D.cs @@ -1,5 +1,3 @@ -using System; - namespace Syntriax.Engine.Core; /// @@ -316,7 +314,7 @@ public readonly struct Vector2D(float x, float y) /// Generates a hash code for the . /// /// A hash code for the . - public override int GetHashCode() => HashCode.Combine(X, Y); + public override int GetHashCode() => System.HashCode.Combine(X, Y); } /// diff --git a/Engine.Core/Primitives/Vector3D.cs b/Engine.Core/Primitives/Vector3D.cs index 1c869e1..420abe4 100644 --- a/Engine.Core/Primitives/Vector3D.cs +++ b/Engine.Core/Primitives/Vector3D.cs @@ -1,5 +1,3 @@ -using System; - namespace Syntriax.Engine.Core; /// @@ -290,7 +288,7 @@ public readonly struct Vector3D(float x, float y, float z) /// Generates a hash code for the . /// /// A hash code for the . - public override int GetHashCode() => HashCode.Combine(X, Y, Z); + public override int GetHashCode() => System.HashCode.Combine(X, Y, Z); } ///