diff --git a/GlitchyEngine/src/Math/Vector2.bf b/GlitchyEngine/src/Math/Vector2.bf index 0705248..c3d9517 100644 --- a/GlitchyEngine/src/Math/Vector2.bf +++ b/GlitchyEngine/src/Math/Vector2.bf @@ -133,7 +133,7 @@ namespace GlitchyEngine.Math /** * Calculates the projection of a onto b */ - public Vector2 Project(Vector2 a, Vector2 b) + public static Vector2 Project(Vector2 a, Vector2 b) { return (b * (Dot(a, b) / Dot(b, b))); } @@ -141,7 +141,7 @@ namespace GlitchyEngine.Math /** * Calculates the rejection of a from b */ - public Vector2 Reject(Vector2 a, Vector2 b) + public static Vector2 Reject(Vector2 a, Vector2 b) { return (a - b * (Dot(a, b) / Dot(b, b))); } @@ -159,6 +159,16 @@ namespace GlitchyEngine.Math return a + interpolationValue * (b - a); } + public static Vector2 Min(Vector2 a, Vector2 b) + { + return .(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)); + } + + public static Vector2 Max(Vector2 a, Vector2 b) + { + return .(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y)); + } + // // Assignment operators // diff --git a/GlitchyEngine/src/Math/Vector3.bf b/GlitchyEngine/src/Math/Vector3.bf index 0f2e295..3b67c59 100644 --- a/GlitchyEngine/src/Math/Vector3.bf +++ b/GlitchyEngine/src/Math/Vector3.bf @@ -193,6 +193,16 @@ namespace GlitchyEngine.Math { return a + interpolationValue * (b - a); } + + public static Vector3 Min(Vector3 a, Vector3 b) + { + return .(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y), Math.Min(a.Z, b.Z)); + } + + public static Vector3 Max(Vector3 a, Vector3 b) + { + return .(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y), Math.Min(a.Z, b.Z)); + } // // Assignment operators diff --git a/GlitchyEngine/src/Math/Vector4.bf b/GlitchyEngine/src/Math/Vector4.bf index 18bf9c8..1578a41 100644 --- a/GlitchyEngine/src/Math/Vector4.bf +++ b/GlitchyEngine/src/Math/Vector4.bf @@ -178,6 +178,16 @@ namespace GlitchyEngine.Math { return a + interpolationValue * (b - a); } + + public static Vector4 Min(Vector4 a, Vector4 b) + { + return .(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y), Math.Min(a.Z, b.Z), Math.Min(a.W, b.W)); + } + + public static Vector4 Max(Vector4 a, Vector4 b) + { + return .(Math.Max(a.X, b.X), Math.Max(a.Y, b.Y), Math.Min(a.Z, b.Z), Math.Min(a.W, b.W)); + } // // Assignment operators