public bool Test(AXLine line) { foreach (TileCollisionManager manager in _managers) { if (manager.OverlapsAny(line)) return true; } return false; }
public static bool TestOverlapEdge(AXLine xlMask, TriangleMask triMask) { VectorFP a = (VectorFP)triMask._pos + triMask._p0; VectorFP b = (VectorFP)triMask._pos + triMask._p1; VectorFP c = (VectorFP)triMask._pos + triMask._p2; if (xlMask.IntersectsLineEdge(a, b) || xlMask.IntersectsLineEdge(b, c) || xlMask.IntersectsLineEdge(a, c)) { return true; } VectorFP q = triMask.Barycentric(xlMask.LeftPoint); return (q.X >= 0 && q.Y >= 0 && (q.X + q.Y) <= 1); }
public static bool TestOverlapEdge(AXLine xlMask, AABBMask rMask) { VectorFP r1 = (VectorFP)rMask._pos + rMask._point; VectorFP r2 = r1 + new VectorFP(rMask._w, rMask._h); return !(xlMask.Y > r2.Y || xlMask.Y < r1.Y || xlMask.Left > r2.X || xlMask.Right < r1.X); }
public static bool TestOverlapEdge(PointMask ptMask, AXLine xlMask) { VectorFP p1 = (VectorFP)ptMask._pos + ptMask._point; return TestOverlapEdge(xlMask, p1.X, p1.Y); }
public static bool TestOverlapEdge(AXLine xlMask, FPInt x, FPInt y) { return (y == xlMask.Y && x >= xlMask.Left && x <= xlMask.Right); }
// Composite -- [____] Collision Tests public static bool TestOverlap(AXLine xl, CompositeMask comMask) { RectangleFP comBounds = comMask.Bounds; if (xl.Left >= comBounds.Right || xl.Right <= comBounds.Left || xl.Y <= comBounds.Top || xl.Y >= comBounds.Bottom) { return false; } foreach (Mask m in comMask._components) { if (m.TestOverlap(xl)) { return true; } } return false; }
public override bool TestOverlapEdge(AXLine line) { return Collision.TestOverlapEdge(line, this); }
public static bool TestOverlap(AXLine xlMask, LineMask lnMask) { VectorFP c = (VectorFP)lnMask._pos + lnMask._p0; VectorFP d = c + new VectorFP(lnMask._w, lnMask._h); return xlMask.IntersectsLine(c, d); }
public static bool TestOverlap(AYLineMask ylMask, AXLine xlMask) { return TestOverlap(xlMask, ylMask); }
public static bool TestOverlap(AXLine xlMask1, AXLineMask xlMask2) { return false; }
public static bool TestOverlap(AXLine xlMask, AYLineMask ylMask) { return ylMask.IntersectsLine(xlMask.LeftPoint, xlMask.RightPoint); }
public static bool TestOverlap(AXLine xlMask, CircleMask cMask) { return TestOverlap(cMask, xlMask); }
public static bool TestOverlap(AXLine xlMask, PointMask ptMask) { return TestOverlap(ptMask, xlMask); }
public static bool TestOverlap(CircleMask cMask, AXLine xl) { VectorFP c1 = (VectorFP)cMask._pos + cMask._p; VectorFP c2 = xl.ClosestPoint(c1); FPInt d2 = VectorFP.DistanceSquared(c1, c2); FPInt r2 = cMask._radius * cMask._radius; return (r2 < d2); }
public static bool TestOverlapEdge(AABBMask rMask, AXLine xlMask) { return TestOverlapEdge(xlMask, rMask); }
public static bool TestOverlap(PointMask ptMask, AXLine xl) { return false; }
public static bool TestOverlapEdge(TriangleMask triMask, AXLine xlMAsk) { return TestOverlapEdge(xlMAsk, triMask); }
public static bool TestOverlap(LineMask lnMask, AXLine xlMask) { return TestOverlap(xlMask, lnMask); }
public bool OverlapsEdgeAny(AXLine line) { int minX = Math.Max(0, (int)(line.Left / _tileWidth)); int maxX = Math.Min(_width - 1, (int)(line.Right / _tileWidth)); int y = Math.Max(0, Math.Min(_height - 1, (int)(line.Y.Floor / _tileHeight))); for (int x = minX; x <= maxX; x++) { if (_grid[x, y] != null && _grid[x, y].TestOverlapEdge(line)) return true; }; return false; }
public virtual bool TestOverlap(AXLine line) { return false; }