示例#1
0
        MapTriangulator(WallGrid grid)
        {
            this.grid = grid;
            int maxPossibleVertices = grid.Length * grid.Width;

            vertexIndices = new VertexIndex[MarchingSquares.MAX_VERTICES_IN_TRIANGULATION];
            localVertices = new List <LocalPosition>(maxPossibleVertices);
            triangles     = new List <VertexIndex>(maxPossibleVertices * 6);
            vertexCache   = new VertexLookup(grid.Length);
        }
示例#2
0
        public MapTriangulator(Map map)
        {
            this.map      = map;
            vertexIndices = new VertexIndex[MAX_VERTICES_IN_TRIANGULATION];
            int maxPossibleVertices = map.length * map.width;

            localVertices = new List <Vector2>(maxPossibleVertices);
            triangles     = new List <VertexIndex>(maxPossibleVertices * 6);
            vertexCache   = new VertexLookup(map.length);
        }