public static bool TestOverlapEdge(PointMask ptMask, AYLineMask ylMask) { VectorFP p1 = (VectorFP)ptMask._pos + ptMask._point; return TestOverlapEdge(ylMask, p1.X, p1.Y); }
public static bool TestOverlap(TriangleMask triMask, AYLineMask ylMask) { return TestOverlap(ylMask, triMask); }
public static bool TestOverlapEdge(AYLineMask ylMask, FPInt x, FPInt y) { VectorFP p2 = (VectorFP)ylMask._pos + ylMask._p; return (x == p2.X && y >= p2.Y && y <= p2.Y + ylMask._h); }
public static bool TestOverlap(PointMask ptMask, AYLineMask ylMask) { return false; }
public static bool TestOverlap(AABBMask rMask, AYLineMask ylMask) { return TestOverlap(ylMask, rMask); }
public static bool TestOverlap(AYLine ylMask1, AYLineMask ylMask2) { return false; }
public static bool TestOverlap(LineMask lnMask, AYLineMask ylMask) { return TestOverlap(ylMask, lnMask); }
public static bool TestOverlap(AYLineMask ylMask, AABBMask rMask) { FPInt px = ylMask._pos.X + ylMask._p.X; FPInt py1 = ylMask._pos.Y + ylMask._p.Y; FPInt py2 = py1 + ylMask._h; VectorFP r1 = (VectorFP)rMask._pos + rMask._point; VectorFP r2 = r1 + new VectorFP(rMask._w, rMask._h); return !(px >= r2.X || px <= r1.X || py1 >= r2.Y || py2 <= r1.Y); }
public static bool TestOverlap(AYLineMask ylMask, TriangleMask triMask) { VectorFP a = (VectorFP)triMask._pos + triMask._p0; VectorFP b = (VectorFP)triMask._pos + triMask._p1; VectorFP c = (VectorFP)triMask._pos + triMask._p2; if (ylMask.IntersectsLine(a, b) || ylMask.IntersectsLine(b, c) || ylMask.IntersectsLine(a, c)) { return true; } VectorFP q = triMask.Barycentric((VectorFP)ylMask._pos + ylMask._p); return (q.X >= 0 && q.Y >= 0 && (q.X + q.Y) <= 1); }
public static bool TestOverlap(AYLineMask ylMask, AXLine xlMask) { return TestOverlap(xlMask, ylMask); }
public static bool TestOverlap(AYLineMask ylMask, LineMask lnMask) { VectorFP c = (VectorFP)lnMask._pos + lnMask._p0; VectorFP d = c + new VectorFP(lnMask._w, lnMask._h); return ylMask.IntersectsLine(c, d); }
public static bool TestOverlap(AYLineMask ylMask, CircleMask cMask) { return TestOverlap(cMask, ylMask); }
// AYLine -- [____] Collision Tests public static bool TestOverlap(AYLineMask ylMask, PointMask ptMask) { return TestOverlap(ptMask, ylMask); }
public static bool TestOverlap(AXLine xlMask, AYLineMask ylMask) { return ylMask.IntersectsLine(xlMask.LeftPoint, xlMask.RightPoint); }
public static bool TestOverlap(AXLineMask xlMask, AYLineMask ylMask) { VectorFP c = (VectorFP)xlMask._pos + xlMask._p; VectorFP d = c + new VectorFP(xlMask._w, 0); return ylMask.IntersectsLine(c, d); }
public static bool TestOverlap(CircleMask cMask, AYLineMask ylMask) { VectorFP c1 = (VectorFP)cMask._pos + cMask._p; VectorFP c2 = ylMask.ClosestPoint(c1); FPInt d2 = VectorFP.DistanceSquared(c1, c2); FPInt r2 = cMask._radius * cMask._radius; return (r2 < d2); }