public bool4 Overlap(ref FourAabb aabb) { var lower4 = (aabb.MinX <= MaxX) & (aabb.MinY <= MaxY); var upper4 = (aabb.MaxX >= MinX) & (aabb.MaxY >= MinY); return(lower4 & upper4); }
public bool4 Overlap1Vs4(ref FourAabb aabbT) { var lc = (aabbT.MinX <= MaxX) & (aabbT.MinY <= MaxY); var hc = (aabbT.MaxX >= MinX) & (aabbT.MaxY >= MinY); var c = lc & hc; return(c); }
public float4 DistanceFromAabbSquared(ref FourAabb aabb) { var px = math.max(float4.zero, aabb.MinX - MaxX); px = math.min(px, aabb.MaxX - MinX); var py = math.max(float4.zero, aabb.MinY - MaxY); py = math.min(py, aabb.MaxY - MinY); return(px * px + py * py); }
public bool4 Overlap1Vs4(ref FourAabb other, int index) { var aabbT = other.GetAabbT(index); return(Overlap1Vs4(ref aabbT)); }