public Update ( |
||
face | ||
edgeIndex | int | |
dim | int | |
Résultat | void |
private void CommitCone() { for (int i = 0; i < ConeFaceBuffer.Count; i++) { DeferredFace deferredFace = ConeFaceBuffer[i]; ConvexFaceInternal face = deferredFace.Face; ConvexFaceInternal pivot = deferredFace.Pivot; ConvexFaceInternal oldFace = deferredFace.OldFace; int faceIndex = deferredFace.FaceIndex; face.AdjacentFaces[faceIndex] = pivot.Index; pivot.AdjacentFaces[deferredFace.PivotIndex] = face.Index; for (int j = 0; j < NumOfDimensions; j++) { if (j != faceIndex) { FaceConnector connector = ObjectManager.GetConnector(); connector.Update(face, j, NumOfDimensions); ConnectFace(connector); } } if (pivot.VerticesBeyond.Count == 0) { FindBeyondVertices(face, oldFace.VerticesBeyond); } else if (pivot.VerticesBeyond.Count < oldFace.VerticesBeyond.Count) { FindBeyondVertices(face, pivot.VerticesBeyond, oldFace.VerticesBeyond); } else { FindBeyondVertices(face, oldFace.VerticesBeyond, pivot.VerticesBeyond); } if (face.VerticesBeyond.Count == 0) { ConvexFaces.Add(face.Index); UnprocessedFaces.Remove(face); ObjectManager.DepositVertexBuffer(face.VerticesBeyond); face.VerticesBeyond = EmptyBuffer; } else { UnprocessedFaces.Add(face); } ObjectManager.DepositDeferredFace(deferredFace); } for (int k = 0; k < AffectedFaceBuffer.Count; k++) { int num = AffectedFaceBuffer[k]; UnprocessedFaces.Remove(FacePool[num]); ObjectManager.DepositFace(num); } }
private void CommitCone() { int num = 0; while (num < this.ConeFaceBuffer.Count) { DeferredFace face = this.ConeFaceBuffer[num]; ConvexFaceInternal internal2 = face.Face; ConvexFaceInternal pivot = face.Pivot; ConvexFaceInternal oldFace = face.OldFace; int faceIndex = face.FaceIndex; internal2.AdjacentFaces[faceIndex] = pivot.Index; pivot.AdjacentFaces[face.PivotIndex] = internal2.Index; int edgeIndex = 0; while (true) { if (edgeIndex >= this.Dimension) { if (pivot.VerticesBeyond.Count == 0) { this.FindBeyondVertices(internal2, oldFace.VerticesBeyond); } else if (pivot.VerticesBeyond.Count < oldFace.VerticesBeyond.Count) { this.FindBeyondVertices(internal2, pivot.VerticesBeyond, oldFace.VerticesBeyond); } else { this.FindBeyondVertices(internal2, oldFace.VerticesBeyond, pivot.VerticesBeyond); } if (internal2.VerticesBeyond.Count != 0) { this.UnprocessedFaces.Add(internal2); } else { this.ConvexFaces.Add(internal2.Index); this.UnprocessedFaces.Remove(internal2); this.ObjectManager.DepositVertexBuffer(internal2.VerticesBeyond); internal2.VerticesBeyond = this.EmptyBuffer; } this.ObjectManager.DepositDeferredFace(face); num++; break; } if (edgeIndex != faceIndex) { FaceConnector connector = this.ObjectManager.GetConnector(); connector.Update(internal2, edgeIndex, this.Dimension); this.ConnectFace(connector); } edgeIndex++; } } for (int i = 0; i < this.AffectedFaceBuffer.Count; i++) { int index = this.AffectedFaceBuffer[i]; this.UnprocessedFaces.Remove(this.FacePool[index]); this.ObjectManager.DepositFace(index); } }