예제 #1
0
        public static bool TestOverlapEdge(PointMask ptMask, AYLineMask ylMask)
        {
            VectorFP p1 = (VectorFP)ptMask._pos + ptMask._point;

            return TestOverlapEdge(ylMask, p1.X, p1.Y);
        }
예제 #2
0
 public static bool TestOverlap(TriangleMask triMask, AYLineMask ylMask)
 {
     return TestOverlap(ylMask, triMask);
 }
예제 #3
0
        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);
        }
예제 #4
0
 public static bool TestOverlap(PointMask ptMask, AYLineMask ylMask)
 {
     return false;
 }
예제 #5
0
 public static bool TestOverlap(AABBMask rMask, AYLineMask ylMask)
 {
     return TestOverlap(ylMask, rMask);
 }
예제 #6
0
 public static bool TestOverlap(AYLine ylMask1, AYLineMask ylMask2)
 {
     return false;
 }
예제 #7
0
 public static bool TestOverlap(LineMask lnMask, AYLineMask ylMask)
 {
     return TestOverlap(ylMask, lnMask);
 }
예제 #8
0
        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);
        }
예제 #9
0
        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);
        }
예제 #10
0
 public static bool TestOverlap(AYLineMask ylMask, AXLine xlMask)
 {
     return TestOverlap(xlMask, ylMask);
 }
예제 #11
0
        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);
        }
예제 #12
0
 public static bool TestOverlap(AYLineMask ylMask, CircleMask cMask)
 {
     return TestOverlap(cMask, ylMask);
 }
예제 #13
0
 // AYLine -- [____] Collision Tests
 public static bool TestOverlap(AYLineMask ylMask, PointMask ptMask)
 {
     return TestOverlap(ptMask, ylMask);
 }
예제 #14
0
 public static bool TestOverlap(AXLine xlMask, AYLineMask ylMask)
 {
     return ylMask.IntersectsLine(xlMask.LeftPoint, xlMask.RightPoint);
 }
예제 #15
0
        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);
        }
예제 #16
0
        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);
        }