public Vector4Fix16 TransformV4(Matrix4x4Fix16 matrix) => Vector4Fix16.Transform(this, matrix);
public static Vector3Fix16 TransformNormal(Vector3Fix16 normal, Matrix4x4Fix16 matrix) => new Vector3Fix16((normal.X * matrix.M11) + (normal.Y * matrix.M21) + (normal.Z * matrix.M31), (normal.X * matrix.M12) + (normal.Y * matrix.M22) + (normal.Z * matrix.M32), (normal.X * matrix.M13) + (normal.Y * matrix.M23) + (normal.Z * matrix.M33));
public Vector3Fix16 TransformNormal(Matrix4x4Fix16 matrix) => Transform(this, matrix);
public Vector2Fix16 Transform(Matrix4x4Fix16 matrix) => Transform(this, matrix);
public static Vector3Fix16 Transform(Vector3Fix16 vector, Matrix4x4Fix16 matrix) => new Vector3Fix16((vector.X * matrix.M11) + (vector.Y * matrix.M21) + (vector.Z * matrix.M31) + matrix.M41, (vector.X * matrix.M12) + (vector.Y * matrix.M22) + (vector.Z * matrix.M32) + matrix.M42, (vector.X * matrix.M13) + (vector.Y * matrix.M23) + (vector.Z * matrix.M33) + matrix.M43);
public static Vector2Fix16 TransformNormal(Vector2Fix16 normal, Matrix4x4Fix16 matrix) => new Vector2Fix16((normal.X * matrix.M11) + (normal.Y * matrix.M21), (normal.X * matrix.M12) + (normal.Y * matrix.M22));
public static Vector2Fix16 Transform(Vector2Fix16 vector, Matrix4x4Fix16 matrix) => new Vector2Fix16((vector.X * matrix.M11) + (vector.Y * matrix.M21) + matrix.M41, (vector.X * matrix.M12) + (vector.Y * matrix.M22) + matrix.M42);
static Matrix4x4Fix16 SoftwareFallback(Matrix4x4Fix16 matrix) { var m2 = matrix.M11; var m3 = matrix.M12; var m4 = matrix.M13; var m5 = matrix.M14; var a = m2; var b = m3; var c = m4; var d = m5; m4 = matrix.M21; m3 = matrix.M22; m2 = matrix.M23; var m6 = matrix.M24; var e = m4; var f = m3; var g = m2; var h = m6; m2 = matrix.M31; m3 = matrix.M32; m4 = matrix.M33; var m7 = matrix.M34; var i = m2; var j = m3; var k = m4; var l = m7; m4 = matrix.M41; m3 = matrix.M42; m2 = matrix.M43; var m8 = matrix.M44; var m = m4; var n = m3; var o = m2; var p = m8; var kp_lo = (k * p) - (l * o); var jp_ln = (j * p) - (l * n); var jo_kn = (j * o) - (k * n); var ip_lm = (i * p) - (l * m); var io_km = (i * o) - (k * m); var in_jm = (i * n) - (j * m); var a2 = (f * kp_lo) - (g * jp_ln) + (h * jo_kn); var a3 = -((e * kp_lo) - (g * ip_lm) + (h * io_km)); var a4 = (e * jp_ln) - (f * ip_lm) + (h * in_jm); var a5 = -((e * jo_kn) - (f * io_km) + (g * in_jm)); var det = (a * a2) + (b * a3) + (c * a4) + (d * a5); if (det == Fix16.Zero) { return(Zero); } var invDet = Fix16.One / det; var gp_ho = (g * p) - (h * o); var fp_hn = (f * p) - (h * n); var fo_gn = (f * o) - (g * n); var ep_hm = (e * p) - (h * m); var eo_gm = (e * o) - (g * m); var en_fm = (e * n) - (f * m); var gl_hk = (g * l) - (h * k); var fl_hj = (f * l) - (h * j); var fk_gj = (f * k) - (g * j); var el_hi = (e * l) - (h * i); var ek_gi = (e * k) - (g * i); var ej_fi = (e * j) - (f * i); var m9 = a2 * invDet; m2 = a3 * invDet; m3 = a4 * invDet; m4 = a5 * invDet; var m10 = -((b * kp_lo) - (c * jp_ln) + (d * jo_kn)) * invDet; var m11 = ((a * kp_lo) - (c * ip_lm) + (d * io_km)) * invDet; var m12 = -((a * jp_ln) - (b * ip_lm) + (d * in_jm)) * invDet; var m13 = ((a * jo_kn) - (b * io_km) + (c * in_jm)) * invDet; var m14 = ((b * gp_ho) - (c * fp_hn) + (d * fo_gn)) * invDet; var m15 = -((a * gp_ho) - (c * ep_hm) + (d * eo_gm)) * invDet; var m16 = ((a * fp_hn) - (b * ep_hm) + (d * en_fm)) * invDet; var m17 = -((a * fo_gn) - (b * eo_gm) + (c * en_fm)) * invDet; return(new Matrix4x4Fix16(m9, m10, m14, -((b * gl_hk) - (c * fl_hj) + (d * fk_gj)) * invDet, m2, m11, m15, ((a * gl_hk) - (c * el_hi) + (d * ek_gi)) * invDet, m3, m12, m16, -((a * fl_hj) - (b * el_hi) + (d * ej_fi)) * invDet, m4, m13, m17, ((a * fk_gj) - (b * ek_gi) + (c * ej_fi)) * invDet)); }
public static Matrix4x4Fix16 Invert(Matrix4x4Fix16 matrix) { return(SoftwareFallback(matrix));
public static Matrix4x4Fix16 Add(Matrix4x4Fix16 left, Matrix4x4Fix16 right) => left + right;