Пример #1
0
        public override object Clone()
        {
            CircleMask mask = new CircleMask(_p, _radius);
            mask._pos = _pos;

            return mask;
        }
Пример #2
0
        public static bool TestOverlap(CircleMask cMask, FPInt x, FPInt y)
        {
            VectorFP p1 = (VectorFP)cMask._pos + cMask._p;

            FPInt dx = p1.X - x;
            FPInt dy = p1.Y - y;
            FPInt d2 = dx * dx + dy * dy;
            FPInt r2 = cMask._radius * cMask._radius;

            return (d2 < r2);
        }
Пример #3
0
        public static bool TestOverlap(CircleMask cMask1, CircleMask cMask2)
        {
            VectorFP p0 = (VectorFP)cMask1._pos + cMask1._p;
            VectorFP p1 = (VectorFP)cMask2._pos + cMask2._p;

            FPInt dx = p1.X - p0.X;
            FPInt dy = p1.Y - p0.Y;
            FPInt d2 = dx * dx + dy * dy;
            FPInt r = cMask1._radius + cMask2._radius;
            FPInt r2 = r * r;

            return (d2 < r2);
        }
Пример #4
0
 // Circle -- [____] Collision Tests
 public static bool TestOverlap(CircleMask cMask, PointMask ptMask)
 {
     return TestOverlap(ptMask, cMask);
 }
Пример #5
0
        public static bool TestOverlapEdge(PointMask ptMask, CircleMask cMask)
        {
            VectorFP p0 = (VectorFP)ptMask._pos + ptMask._point;

            return TestOverlapEdge(cMask, p0.X, p0.Y);
        }
Пример #6
0
 public static bool TestOverlap(TriangleMask triMask, CircleMask cMask)
 {
     return TestOverlap(cMask, triMask);
 }
Пример #7
0
 public static bool TestOverlap(AABBMask rMask, CircleMask cMask)
 {
     return TestOverlap(cMask, rMask);
 }
Пример #8
0
 public static bool TestOverlap(LineMask lnMask, CircleMask cMask)
 {
     return TestOverlap(cMask, lnMask);
 }
Пример #9
0
 public static bool TestOverlap(AYLine ylMask, CircleMask cMask)
 {
     return TestOverlap(cMask, ylMask);
 }
Пример #10
0
 public static bool TestOverlap(AXLine xlMask, CircleMask cMask)
 {
     return TestOverlap(cMask, xlMask);
 }
Пример #11
0
        public static bool TestOverlap(CircleMask cMask, TriangleMask triMask)
        {
            VectorFP p0 = (VectorFP)cMask._pos + cMask._p;
            VectorFP p1 = triMask.ClosestPoint(p0);

            FPInt dx = p1.X - p0.X;
            FPInt dy = p1.Y - p0.Y;
            FPInt d2 = dx * dx + dy * dy;
            FPInt r2 = cMask._radius * cMask._radius;

            return (d2 < r2);
        }
Пример #12
0
        public static bool TestOverlap(CircleMask cMask, LineMask lnMask)
        {
            VectorFP c = (VectorFP)cMask._pos + cMask._p;
            VectorFP p = lnMask.ClosestPoint(c);

            p = p - c;
            FPInt p2 = p.LengthSquared();
            FPInt r2 = cMask._radius * cMask._radius;

            return (p2 < r2);
        }
Пример #13
0
        public static bool TestOverlap(CircleMask cMask, AYLine yl)
        {
            VectorFP c1 = (VectorFP)cMask._pos + cMask._p;
            VectorFP c2 = yl.ClosestPoint(c1);

            FPInt d2 = VectorFP.DistanceSquared(c1, c2);
            FPInt r2 = cMask._radius * cMask._radius;

            return (r2 < d2);
        }