feat: added Matrix4x4 x Vector4D multiplication
This commit is contained in:
@@ -94,6 +94,13 @@ public readonly struct Matrix4x4(
|
|||||||
a.M41 * b.M14 + a.M42 * b.M24 + a.M43 * b.M34 + a.M44 * b.M44
|
a.M41 * b.M14 + a.M42 * b.M24 + a.M43 * b.M34 + a.M44 * b.M44
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public static Vector4D operator *(Matrix4x4 m, Vector4D v) => new(
|
||||||
|
m.M11 * v.X + m.M12 * v.Y + m.M13 * v.Z + m.M14 * v.W,
|
||||||
|
m.M21 * v.X + m.M22 * v.Y + m.M23 * v.Z + m.M24 * v.W,
|
||||||
|
m.M31 * v.X + m.M32 * v.Y + m.M33 * v.Z + m.M34 * v.W,
|
||||||
|
m.M41 * v.X + m.M42 * v.Y + m.M43 * v.Z + m.M44 * v.W
|
||||||
|
);
|
||||||
|
|
||||||
public static bool operator ==(Matrix4x4 left, Matrix4x4 right) =>
|
public static bool operator ==(Matrix4x4 left, Matrix4x4 right) =>
|
||||||
left.M11 == right.M11 && left.M12 == right.M12 && left.M13 == right.M13 && left.M14 == right.M14 &&
|
left.M11 == right.M11 && left.M12 == right.M12 && left.M13 == right.M13 && left.M14 == right.M14 &&
|
||||||
left.M21 == right.M21 && left.M22 == right.M22 && left.M23 == right.M23 && left.M24 == right.M24 &&
|
left.M21 == right.M21 && left.M22 == right.M22 && left.M23 == right.M23 && left.M24 == right.M24 &&
|
||||||
|
|||||||
Reference in New Issue
Block a user