public void Execute(int index) { SideCellInfo info = infoArray[index]; topVertexCalculator.CalculateVertices(index, info.info, info.topVerts, vertices); bottomVertexCalculator.CalculateVertices(index, info.info, info.bottomVerts, vertices); }
static public SideCellInfo GenerateInfoNoTriangles(float cornerDistance, float rightDistance, float topRightDistance, float topDistance, ref int nextVertex, ref int nextTriIndex) { byte config = CalcConfiguration(cornerDistance, rightDistance, topRightDistance, topDistance); SideCellInfo info = new SideCellInfo { info = new CellInfo { config = config, cornerDist = cornerDistance, rightDist = rightDistance, topDist = topDistance }, topVerts = CreateCellVertices(config, ref nextVertex), bottomVerts = CreateCellVertices(config, ref nextVertex), tris = new IndexSpan(nextTriIndex, 0) }; return(info); }
public void Execute(int index) { int cellColNum = cornerColNum - 1; int x = index % cellColNum; int y = index / cellColNum; index = y * cornerColNum + x; SideCellInfo bl = infoArray[index]; SideCellInfo br = infoArray[index + 1]; SideCellInfo tl = infoArray[index + cornerColNum]; SideCellInfo tr = infoArray[index + cornerColNum + 1]; int triangleIndex = bl.tris.start; triangleIndex = CalculateSideIndices(topOrderer, triangleIndex, bl, br, tl, triangles); triangleIndex = CalculateIndices(topOrderer, bl.info.config, triangleIndex, bl.tris, bl.topVerts, br.topVerts, tr.topVerts, tl.topVerts, triangles); CalculateIndices(bottomOrderer, bl.info.config, triangleIndex, bl.tris, bl.bottomVerts, br.bottomVerts, tr.bottomVerts, tl.bottomVerts, triangles); }
public void CalculateUvs(SideCellInfo info, NativeArray <float3> vertices, NativeArray <float2> uvs) { SetSideUV(info.topVerts.leftEdge, info.bottomVerts.leftEdge, vertices, uvs, scaleU, scaleV); SetSideUV(info.topVerts.bottomEdge, info.bottomVerts.bottomEdge, vertices, uvs, scaleU, scaleV); }