public void Exec() { if (_reqList.Count == 0 || Pause) { return; } foreach (SurfExtractReqTrans req in _reqList.Values) { // Not check out of date because add_req is just called before this method in the same thread. if (req._faceMask != 0) { TransVertices verts = new TransVertices(); List <int> indexedIndices = new List <int>(); float cellSize = 0.01f; TransvoxelExtractor2.BuildTransitionCells(req._faceMask, req._chunkData, cellSize, verts, indexedIndices); //int nVerts = verts.Count; int chunkVertsCurCnt = TransvoxelGoCreator.UnindexedVertex(verts, indexedIndices, out req.vert, out req.norm01, out req.norm2t); req.indice = new int[chunkVertsCurCnt]; Array.Copy(SurfExtractorsMan.s_indiceMax, req.indice, chunkVertsCurCnt); } lock (_reqFinishedList){ _reqFinishedList.Add(req); } } _reqList.Clear(); }
public static void CreateTransvoxelGo(VFVoxelChunkGo chunkGo, int faceMask) { TransVertices verts = new TransVertices(); List <int> indexedIndices = new List <int>(); float cellSize = 0.01f; TransvoxelExtractor2.BuildTransitionCells(faceMask, chunkGo.Data, cellSize, verts, indexedIndices); Vector3[] vert; Vector2[] norm01; Vector2[] norm2t; int chunkVertsCurCnt = UnindexedVertex(verts, indexedIndices, out vert, out norm01, out norm2t); SurfExtractReqTrans req = new SurfExtractReqTrans(0, null); req.vert = vert; req.norm01 = norm01; req.norm2t = norm2t; req.indice = new int[chunkVertsCurCnt]; Array.Copy(SurfExtractorsMan.s_indiceMax, req.indice, chunkVertsCurCnt); chunkGo.SetTransGo(req, faceMask); }