Esempio n. 1
0
 public MutableMeshTriangle(MutableMesh mesh, MutableMeshVertex v1, MutableMeshVertex v2, MutableMeshVertex v3)
 {
     this.v1   = v1;
     this.v2   = v2;
     this.v3   = v3;
     this.mesh = mesh;
 }
Esempio n. 2
0
        public Square(MutableMesh mesh, Vector3 pos, List <SquarePoint> points)
        {
            this.mesh     = mesh;
            this.Position = pos;
            this.nodes    = new Dictionary <SquarePoint, SquareNode> ();
            this.points   = points;

            foreach (SquarePoint point in Enum.GetValues(typeof(SquarePoint)))
            {
                this.nodes[point] = new SquareNode();
            }
        }
Esempio n. 3
0
        public SquareGrid(int width, int height, MutableMesh mesh)
        {
            grid        = new Square[width, height];
            this.width  = width;
            this.height = height;

            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    grid[i, j] = new Square(mesh, new Vector3(i, j, 0), null);
                }
            }

            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    var square = grid[i, j];
                    if (i != width - 1)
                    {
                        square.JoinWithSquare(grid[i + 1, j], SquarePoint.RightCenter);
                    }
                }
            }
            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    var square = grid[i, j];
                    if (j != height - 1)
                    {
                        square.JoinWithSquare(grid[i, j + 1], SquarePoint.TopCenter);
                    }
                }
            }
        }