public static EdgeIntersect ( LibTessDotNet.MeshUtils.Vertex o1, LibTessDotNet.MeshUtils.Vertex d1, LibTessDotNet.MeshUtils.Vertex o2, LibTessDotNet.MeshUtils.Vertex d2, LibTessDotNet.MeshUtils.Vertex v ) : void | ||
o1 | LibTessDotNet.MeshUtils.Vertex | |
d1 | LibTessDotNet.MeshUtils.Vertex | |
o2 | LibTessDotNet.MeshUtils.Vertex | |
d2 | LibTessDotNet.MeshUtils.Vertex | |
v | LibTessDotNet.MeshUtils.Vertex | |
return | void |
private bool CheckForIntersect(ActiveRegion regUp) { ActiveRegion activeRegion = RegionBelow(regUp); MeshUtils.Edge eUp = regUp._eUp; MeshUtils.Edge eUp2 = activeRegion._eUp; MeshUtils.Vertex org = eUp._Org; MeshUtils.Vertex org2 = eUp2._Org; MeshUtils.Vertex dst = eUp._Dst; MeshUtils.Vertex dst2 = eUp2._Dst; if (org == org2) { return(false); } float num = Math.Min(org._t, dst._t); float num2 = Math.Max(org2._t, dst2._t); if (num > num2) { return(false); } if (Geom.VertLeq(org, org2)) { if (Geom.EdgeSign(dst2, org, org2) > 0f) { return(false); } } else if (Geom.EdgeSign(dst, org2, org) < 0f) { return(false); } MeshUtils.Vertex vertex = MeshUtils.Pooled <MeshUtils.Vertex> .Create(); Geom.EdgeIntersect(dst, org, dst2, org2, vertex); if (Geom.VertLeq(vertex, _event)) { vertex._s = _event._s; vertex._t = _event._t; } MeshUtils.Vertex vertex2 = Geom.VertLeq(org, org2) ? org : org2; if (Geom.VertLeq(vertex2, vertex)) { vertex._s = vertex2._s; vertex._t = vertex2._t; } if (Geom.VertEq(vertex, org) || Geom.VertEq(vertex, org2)) { CheckForRightSplice(regUp); return(false); } if ((!Geom.VertEq(dst, _event) && Geom.EdgeSign(dst, _event, vertex) >= 0f) || (!Geom.VertEq(dst2, _event) && Geom.EdgeSign(dst2, _event, vertex) <= 0f)) { if (dst2 == _event) { _mesh.SplitEdge(eUp._Sym); _mesh.Splice(eUp2._Sym, eUp); regUp = TopLeftRegion(regUp); eUp = RegionBelow(regUp)._eUp; FinishLeftRegions(RegionBelow(regUp), activeRegion); ActiveRegion regUp2 = regUp; MeshUtils.Edge oprev = eUp._Oprev; MeshUtils.Edge edge = eUp; AddRightEdges(regUp2, oprev, edge, edge, true); return(true); } if (dst == _event) { _mesh.SplitEdge(eUp2._Sym); _mesh.Splice(eUp._Lnext, eUp2._Oprev); activeRegion = regUp; regUp = TopRightRegion(regUp); MeshUtils.Edge rprev = RegionBelow(regUp)._eUp._Rprev; activeRegion._eUp = eUp2._Oprev; eUp2 = FinishLeftRegions(activeRegion, null); AddRightEdges(regUp, eUp2._Onext, eUp._Rprev, rprev, true); return(true); } if (Geom.EdgeSign(dst, _event, vertex) >= 0f) { RegionAbove(regUp)._dirty = (regUp._dirty = true); _mesh.SplitEdge(eUp._Sym); eUp._Org._s = _event._s; eUp._Org._t = _event._t; } if (Geom.EdgeSign(dst2, _event, vertex) <= 0f) { regUp._dirty = (activeRegion._dirty = true); _mesh.SplitEdge(eUp2._Sym); eUp2._Org._s = _event._s; eUp2._Org._t = _event._t; } return(false); } _mesh.SplitEdge(eUp._Sym); _mesh.SplitEdge(eUp2._Sym); _mesh.Splice(eUp2._Oprev, eUp); eUp._Org._s = vertex._s; eUp._Org._t = vertex._t; eUp._Org._pqHandle = _pq.Insert(eUp._Org); if (eUp._Org._pqHandle._handle == PQHandle.Invalid) { throw new InvalidOperationException("PQHandle should not be invalid"); } GetIntersectData(eUp._Org, org, dst, org2, dst2); RegionAbove(regUp)._dirty = (regUp._dirty = (activeRegion._dirty = true)); return(false); }