public bool4 Overlap1Vs4(ref FourTransposedAabbs aabbT) { bool4 lc = (aabbT.Lx <= Hx) & (aabbT.Ly <= Hy) & (aabbT.Lz <= Hz); bool4 hc = (aabbT.Hx >= Lx) & (aabbT.Hy >= Ly) & (aabbT.Hz >= Lz); bool4 c = lc & hc; return(c); }
public float4 DistanceFromAabbSquared(ref FourTransposedAabbs tranposedAabb, float3 scale) { float4 px = math.max(float4.zero, tranposedAabb.Lx - Hx); px = math.min(px, tranposedAabb.Hx - Lx) * scale.x; float4 py = math.max(float4.zero, tranposedAabb.Ly - Hy); py = math.min(py, tranposedAabb.Hy - Ly) * scale.y; float4 pz = math.max(float4.zero, tranposedAabb.Lz - Hz); pz = math.min(pz, tranposedAabb.Hz - Lz) * scale.z; return(px * px + py * py + pz * pz); }
public bool4 Overlap1Vs4(ref FourTransposedAabbs other, int index) { FourTransposedAabbs aabbT = other.GetAabbT(index); return(Overlap1Vs4(ref aabbT)); }