private static ShouldEdgesSnap ( |
||
a | ||
b | ||
Résultat | bool |
internal static void Snap(SnapEdge edge, List <SnapEdge> otherEdges, ref float maxDist, ref float snapVal, List <KeyValuePair <SnapEdge, SnapEdge> > activeEdges) { using (List <SnapEdge> .Enumerator enumerator = otherEdges.GetEnumerator()) { while (enumerator.MoveNext()) { SnapEdge current = enumerator.Current; if (SnapEdge.ShouldEdgesSnap(edge, current)) { float num = Mathf.Abs(current.pos - edge.pos); if ((double)num < (double)maxDist) { maxDist = num; snapVal = current.pos - edge.pos; activeEdges.Clear(); activeEdges.Add(new KeyValuePair <SnapEdge, SnapEdge>(edge, current)); } else if ((double)num == (double)maxDist) { activeEdges.Add(new KeyValuePair <SnapEdge, SnapEdge>(edge, current)); } } } } }
private static bool EdgeInside(SnapEdge edge, List <SnapEdge> frustum) { foreach (SnapEdge current in frustum) { if (!SnapEdge.ShouldEdgesSnap(edge, current)) { return(false); } } return(true); }
private static bool EdgeInside(SnapEdge edge, List <SnapEdge> frustum) { using (List <SnapEdge> .Enumerator enumerator = frustum.GetEnumerator()) { while (enumerator.MoveNext()) { SnapEdge current = enumerator.Current; if (!SnapEdge.ShouldEdgesSnap(edge, current)) { return(false); } } } return(true); }
internal static void Snap(SnapEdge edge, List <SnapEdge> otherEdges, ref float maxDist, ref float snapVal, List <KeyValuePair <SnapEdge, SnapEdge> > activeEdges) { foreach (SnapEdge current in otherEdges) { if (SnapEdge.ShouldEdgesSnap(edge, current)) { float num = Mathf.Abs(current.pos - edge.pos); if (num < maxDist) { maxDist = num; snapVal = current.pos - edge.pos; activeEdges.Clear(); activeEdges.Add(new KeyValuePair <SnapEdge, SnapEdge>(edge, current)); } else if (num == maxDist) { activeEdges.Add(new KeyValuePair <SnapEdge, SnapEdge>(edge, current)); } } } }