public void AllocateBuffers(int trianglesNum) { if (lsHash == null) { // MeshUtils.Log("Allocating contour: " + trianglesNum); midPoints = new ArrayDictionary<MidPoint>(trianglesNum * 2); contour = new List<Dictionary<HashType, int>>(); lsHash = new LSHash(0.001f, trianglesNum * 2); } else { lsHash.Clear(); foreach (var item in contour) { item.Clear(); } contour.Clear(); if (midPoints.Size < trianglesNum*2) { // MeshUtils.Log("Re-allocating midPoint: " + trianglesNum); midPoints = new ArrayDictionary<MidPoint>(trianglesNum * 2); } else { midPoints.Clear(); } } }
public void AllocateBuffers(int trianglesNum) { if (lsHash == null) { // MeshUtils.Log("Allocating contour: " + trianglesNum); midPoints = new ArrayDictionary <MidPoint>(trianglesNum * 2); contour = new List <Dictionary <HashType, int> >(); lsHash = new LSHash(0.001f, trianglesNum * 2); } else { lsHash.Clear(); foreach (var item in contour) { item.Clear(); } contour.Clear(); if (midPoints.Size < trianglesNum * 2) { // MeshUtils.Log("Re-allocating midPoint: " + trianglesNum); midPoints = new ArrayDictionary <MidPoint>(trianglesNum * 2); } else { midPoints.Clear(); } } }