// The floor is visible from above, but the ceiling should be visible from below. By reversing // the triangles we flip the direction of visibility. static void FlipVisibility(MeshData mesh) { System.Array.Reverse(mesh.triangles); }
public EnclosureBuilder(MeshData floorMesh, IHeightMap heightMap) { this.floorMesh = floorMesh; wallHeight = heightMap.BaseHeight; this.heightMap = heightMap; }
public MeshData Build() { mesh = FloorToEnclosureMesh(); ApplyHeightMap(); return(mesh); }
void TriangulateMap() { MapTriangulator mapTriangulator = new MapTriangulator(map); mesh = mapTriangulator.Triangulate(); }