MarchingCubes
A static class in Root.Township, the global namespace.
Static marching cubes mesher: turns a cell of eight density values into triangles at an iso level. Used by the cave MarchingCubesPlugin.
- Listed in Global namespace: M to O
- Nested types
GridCell,Point4,Triangle
Fields
3 private and internal fields
| Member | What it is |
|---|---|
private static int[] edgeMapsTable | Lookup of which cube edges the surface crosses for each corner pattern. |
private static MarchingCubes.Point4[] edgeOffsets | For each of the 12 edges, its offset and axis as a Point4, used as a vertex key. |
private static int[,] triTable | Lookup of the triangles to build for each corner pattern, ended by -1. |
Methods
| Member | What it is |
|---|---|
static void Polygonise(MarchingCubes.GridCell grid, float isolevel, List<MarchingCubes.Triangle> triangles, Vector3[] vertlist) | Adds the triangles for one grid cell to triangles, with edge keys so shared vertices can be merged. |
static Vector3 VertexInterp(float isolevel, Vector3 p1, Vector3 p2, float valp1, float valp2) | Returns the point between two corners where the density crosses the iso level. |