so much work :(
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Numerics;
|
||||||
|
|
||||||
namespace PveTeam.Mathematics
|
namespace PveTeam.Mathematics
|
||||||
{
|
{
|
||||||
@@ -9,10 +10,73 @@ namespace PveTeam.Mathematics
|
|||||||
M31, M32, M33, M34,
|
M31, M32, M33, M34,
|
||||||
M41, M42, M43, M44;
|
M41, M42, M43, M44;
|
||||||
|
|
||||||
|
#region Static fields
|
||||||
|
public static Matrix4x4D Identity => new Matrix4x4D(
|
||||||
|
1, 0, 0, 0,
|
||||||
|
0, 1, 0, 0,
|
||||||
|
0, 0, 1, 0,
|
||||||
|
0, 0, 0, 1);
|
||||||
|
public static Matrix4x4D Zero => new Matrix4x4D(9);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
public Matrix4x4D(Double value) : this(value, value, value, value, value, value, value, value, value, value, value, value, value, value, value, value) { }
|
||||||
|
public Matrix4x4D(Matrix4x4 value) : this(value.M11, value.M12, value.M13, value.M14, value.M21, value.M22, value.M23, value.M24, value.M31, value.M32, value.M33, value.M34, value.M41, value.M42, value.M43, value.M44) { }
|
||||||
|
public Matrix4x4D(Double m11, Double m12, Double m13, Double m14,
|
||||||
|
Double m21, Double m22, Double m23, Double m24,
|
||||||
|
Double m31, Double m32, Double m33, Double m34,
|
||||||
|
Double m41, Double m42, Double m43, Double m44)
|
||||||
|
{
|
||||||
|
M11 = m11;
|
||||||
|
M12 = m12;
|
||||||
|
M13 = m13;
|
||||||
|
M14 = m14;
|
||||||
|
M21 = m21;
|
||||||
|
M22 = m22;
|
||||||
|
M23 = m23;
|
||||||
|
M24 = m24;
|
||||||
|
M31 = m31;
|
||||||
|
M32 = m32;
|
||||||
|
M33 = m33;
|
||||||
|
M34 = m34;
|
||||||
|
M41 = m41;
|
||||||
|
M42 = m42;
|
||||||
|
M43 = m43;
|
||||||
|
M44 = m44;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Instance methods
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Static methods
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Operators
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Operator methods
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Equals
|
||||||
|
public override int GetHashCode()
|
||||||
|
=> M11.GetHashCode() + M12.GetHashCode() + M13.GetHashCode() + M14.GetHashCode()
|
||||||
|
+ M21.GetHashCode() + M22.GetHashCode() + M23.GetHashCode() + M24.GetHashCode()
|
||||||
|
+ M31.GetHashCode() + M32.GetHashCode() + M33.GetHashCode() + M34.GetHashCode()
|
||||||
|
+ M41.GetHashCode() + M42.GetHashCode() + M43.GetHashCode() + M44.GetHashCode();
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
if (!(obj is Matrix4x4D))
|
||||||
|
return false;
|
||||||
|
return Equals((Matrix4x4D)obj);
|
||||||
|
}
|
||||||
|
|
||||||
public bool Equals(Matrix4x4D other)
|
public bool Equals(Matrix4x4D other)
|
||||||
=> M11 == other.M11 && M12 == other.M12 && M13 == other.M13 && M14 == other.M14
|
=> M11 == other.M11 && M12 == other.M12 && M13 == other.M13 && M14 == other.M14
|
||||||
&& M21 == other.M21 && M22 == other.M22 && M23 == other.M23 && M24 == other.M24
|
&& M21 == other.M21 && M22 == other.M22 && M23 == other.M23 && M24 == other.M24
|
||||||
&& M31 == other.M31 && M32 == other.M32 && M33 == other.M33 && M34 == other.M34
|
&& M31 == other.M31 && M32 == other.M32 && M33 == other.M33 && M34 == other.M34
|
||||||
&& M41 == other.M41 && M42 == other.M42 && M43 == other.M43 && M44 == other.M44;
|
&& M41 == other.M41 && M42 == other.M42 && M43 == other.M43 && M44 == other.M44;
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user