public float4x4(int4x4 v) { this.c0 = v.c0; this.c1 = v.c1; this.c2 = v.c2; this.c3 = v.c3; }
public uint4x4(int4x4 v) { this.c0 = (uint4)v.c0; this.c1 = (uint4)v.c1; this.c2 = (uint4)v.c2; this.c3 = (uint4)v.c3; }
public static uint4 hashwide(int4x4 v) { return((asuint(v.c0) * uint4(0xCB634F4Du, 0x9B13B92Du, 0x4ABF0813u, 0x86068063u) + asuint(v.c1) * uint4(0xD75513F9u, 0x5AB3E8CDu, 0x676E8407u, 0xB36DE767u) + asuint(v.c2) * uint4(0x6FCA387Du, 0xAF0F3103u, 0xE4A056C7u, 0x841D8225u) + asuint(v.c3) * uint4(0xC9393C7Du, 0xD42EAFA3u, 0xD9AFD06Du, 0x97A65421u)) + 0x7809205Fu); }
public static uint hash(int4x4 v) { return(csum(asuint(v.c0) * uint4(0x5D1B165Bu, 0x87096CD7u, 0x4C7F6DD1u, 0x4822A3E9u) + asuint(v.c1) * uint4(0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du, 0x614DA60Du) + asuint(v.c2) * uint4(0x5BA2C50Bu, 0x8C455ACBu, 0xCD266C89u, 0xF1852A33u) + asuint(v.c3) * uint4(0x77E35E77u, 0x863E3729u, 0xE191B035u, 0x68586FAFu)) + 0xD4DFF6D3u); }
public static int4x4 transpose(int4x4 v) { return(int4x4( v.c0.x, v.c0.y, v.c0.z, v.c0.w, v.c1.x, v.c1.y, v.c1.z, v.c1.w, v.c2.x, v.c2.y, v.c2.z, v.c2.w, v.c3.x, v.c3.y, v.c3.z, v.c3.w)); }
/// <summary>Returns the determinant of a int4x4 matrix.</summary> public static int determinant(int4x4 m) { int4 c0 = m.c0; int4 c1 = m.c1; int4 c2 = m.c2; int4 c3 = m.c3; int m00 = c1.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c1.z * c3.w - c1.w * c3.z) + c3.y * (c1.z * c2.w - c1.w * c2.z); int m01 = c0.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c2.w - c0.w * c2.z); int m02 = c0.y * (c1.z * c3.w - c1.w * c3.z) - c1.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c1.w - c0.w * c1.z); int m03 = c0.y * (c1.z * c2.w - c1.w * c2.z) - c1.y * (c0.z * c2.w - c0.w * c2.z) + c2.y * (c0.z * c1.w - c0.w * c1.z); return(c0.x * m00 - c1.x * m01 + c2.x * m02 - c3.x * m03); }
public static float4x4 float4x4(int4x4 v) { return(new float4x4(v)); }
public static uint4x4 uint4x4(int4x4 v) { return(new uint4x4(v)); }