public static float3x4 transpose(float4x3 v) { return(float3x4( 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)); }
public static Unity.Mathematics.float3 parallelProjection(Unity.Mathematics.float4 tmpVert) { Unity.Mathematics.float4 planePos = IMRE.ScaleDimension.SpencerStudyControl.ins.hyperPlane; Unity.Mathematics.float4 planeNormal = IMRE.ScaleDimension.SpencerStudyControl.ins.hyperPlaneNormal; Unity.Mathematics.float4 pos = tmpVert - IMRE.Math.HigherDimensionsMaths.project(tmpVert - planePos, planeNormal); //this basis system might be unstable as the axis is moved. Consider defining axis by basis. Unity.Mathematics.float4x3 basis = IMRE.Math.HigherDimensionsMaths.basisSystem(planeNormal); return(new Unity.Mathematics.float3(UnityEngine.Vector4.Dot(pos, basis.c0), UnityEngine.Vector4.Dot(pos, basis.c1), UnityEngine.Vector4.Dot(pos, basis.c2))); }
public static Unity.Mathematics.float3 projectiveProjection(Unity.Mathematics.float4 tmpVert) { Unity.Mathematics.float4 origin = IMRE.ScaleDimension.SpencerStudyControl.ins.origin; Unity.Mathematics.float4 planePos = IMRE.ScaleDimension.SpencerStudyControl.ins.hyperPlane; Unity.Mathematics.float4 planeNormal = IMRE.ScaleDimension.SpencerStudyControl.ins.hyperPlaneNormal; Unity.Mathematics.float4 dir = (tmpVert - origin) / IMRE.Math.Operations.magnitude(tmpVert - origin); float4 pos = Operations.SegmentPlaneIntersection(origin, tmpVert, planePos, planeNormal); /* //normalized direction * Unity.Mathematics.float4 projOnPlane = * tmpVert - IMRE.Math.HigherDimensionsMaths.project(tmpVert - planePos, planeNormal); * //TODO consider if mathf.cos takes an absolute value here * float diff = IMRE.Math.Operations.magnitude(tmpVert - projOnPlane) / * UnityEngine.Mathf.Cos(IMRE.Math.Operations.Angle(planeNormal, dir)); * Unity.Mathematics.float4 pos = tmpVert + diff * dir;*/ //this basis system might be unstable as the axis is moved. Consider defining axis by basis. Unity.Mathematics.float4x3 basis = IMRE.Math.HigherDimensionsMaths.basisSystem(planeNormal); return(new Unity.Mathematics.float3(UnityEngine.Vector4.Dot(pos, basis.c0), UnityEngine.Vector4.Dot(pos, basis.c1), UnityEngine.Vector4.Dot(pos, basis.c2))); }
public int4x3(float4x3 v) { this.c0 = (int4)v.c0; this.c1 = (int4)v.c1; this.c2 = (int4)v.c2; }
public static int4x3 int4x3(float4x3 v) { return(new int4x3(v)); }
public static uint4 hash_wide(float4x3 v) { return((asuint(v.c0) * uint4(0x83B5E729u, 0xC267163Fu, 0x67BC9149u, 0xAD7C5EC1u) + asuint(v.c1) * uint4(0x822A7D6Du, 0xB492BF15u, 0xD37220E3u, 0x7AA2C2BDu) + asuint(v.c2) * uint4(0xE16BC89Du, 0x7AA07CD3u, 0xAF642BA9u, 0xA8F2213Bu)) + 0x9F3FDC37u); }
public static uint hash(float4x3 v) { return(csum(asuint(v.c0) * uint4(0xFE31134Fu, 0x712A34D7u, 0x9D77A59Bu, 0x4942CA39u) + asuint(v.c1) * uint4(0xB40EC62Du, 0x565ED63Fu, 0x93C30C2Bu, 0xDCAF0351u) + asuint(v.c2) * uint4(0x6E050B01u, 0x750FDBF5u, 0x7F3DD499u, 0x52EAAEBBu)) + 0x4599C793u); }
public static double4x3 double4x3(float4x3 v) { return(new double4x3(v)); }
public static fix64p4x3 fix64p4x3(float4x3 v) { return(new fix64p4x3(v)); }
public static uint4x3 uint4x3(float4x3 v) { return(new uint4x3(v)); }
public static uint4 hashwide(float4x3 v) { return((asuint(v.c0) * uint4(0x747A9D7Bu, 0x4111F799u, 0xB5F05AF1u, 0xFD80290Bu) + asuint(v.c1) * uint4(0x8B65ADB7u, 0xDFF4F563u, 0x7069770Du, 0xD1224537u) + asuint(v.c2) * uint4(0xE99ED6F3u, 0x48125549u, 0xEEE2123Bu, 0xE3AD9FE5u)) + 0xCE1CF8BFu); }
public static uint hash(float4x3 v) { return(csum(asuint(v.c0) * uint4(0x841D8225u, 0xC9393C7Du, 0xD42EAFA3u, 0xD9AFD06Du) + asuint(v.c1) * uint4(0x97A65421u, 0x7809205Fu, 0x9C9F0823u, 0x5A9CA13Bu) + asuint(v.c2) * uint4(0xAFCDD5EFu, 0xA88D187Du, 0xCF6EBA1Du, 0x9D88E5A1u)) + 0xEADF0775u); }
public static uint hash(float4x3 v) { return(csum(asuint(v.c0) * uint4(0xA2D00EDFu, 0xA8977779u, 0x9F1C739Bu, 0x4B1BD187u) + asuint(v.c1) * uint4(0x9DF50593u, 0xF18EEB85u, 0x9E19BFC3u, 0x8196B06Fu) + asuint(v.c2) * uint4(0xD24EFA19u, 0x7D8048BBu, 0x713BD06Fu, 0x753AD6ADu)) + 0xD19764C7u); }
public static uint hash(float4x3 v) { return(csum(asuint(v.c0) * uint4(0xC53F4755u, 0x6985C229u, 0xE133B0B3u, 0xC3E0A3B9u) + asuint(v.c1) * uint4(0xFE31134Fu, 0x712A34D7u, 0x9D77A59Bu, 0x4942CA39u) + asuint(v.c2) * uint4(0xB40EC62Du, 0x565ED63Fu, 0x93C30C2Bu, 0xDCAF0351u)) + 0x6E050B01u); }
public double4x3(float4x3 v) { this.c0 = v.c0; this.c1 = v.c1; this.c2 = v.c2; }
public static uint4 hashwide(float4x3 v) { return((asuint(v.c0) * uint4(0x750FDBF5u, 0x7F3DD499u, 0x52EAAEBBu, 0x4599C793u) + asuint(v.c1) * uint4(0x83B5E729u, 0xC267163Fu, 0x67BC9149u, 0xAD7C5EC1u) + asuint(v.c2) * uint4(0x822A7D6Du, 0xB492BF15u, 0xD37220E3u, 0x7AA2C2BDu)) + 0xE16BC89Du); }
public fix64p4x3(float4x3 v) { this.c0 = (fix64p4)v.c0; this.c1 = (fix64p4)v.c1; this.c2 = (fix64p4)v.c2; }