예제 #1
0
    public EMesh(PrismMesh copy, Dictionary <PrismTexture.Tile, TextureSet.Tile> tiles, Layer l, Editor e)
        : this(l, e)
    {
        for (int i = 0; i < vertices.Count; i++)
        {
            vertices[i].Position = copy.VertexPosition[i];
            vertices[i].HSL      = copy.VertexColor[i];
        }

        design = copy.
    }
예제 #2
0
    public void CreateMesh(System.Drawing.RectangleF rect, MeshDesign design)
    {
        if (activeLayers.Count == 0 || activeLayers.Count > 1)
        {
            return;
        }

        EMesh mesh = new EMesh(rect, design, activeLayers[0], this);

        activeLayers[0].AddMesh(mesh);
        SetSelected(new EMesh[] { mesh });

        ActiveHistory.Add(new CreateAction(mesh, ActiveHistory));
    }
예제 #3
0
    public EMesh(PrismMesh copy, Dictionary <PrismTexture.Tile, TextureSet.Tile> tiles, Layer l, Editor e)
        : this(l, e)
    {
        for (int i = 0; i < vertices.Count; i++)
        {
            vertices[i].Position = copy.VertexPosition[i];
            vertices[i].HSL      = copy.VertexColor[i];
        }

        if (copy.Tile != null)
        {
            design = new MeshDesign(tiles[copy.Tile]);
        }
        else
        {
            design = new MeshDesign(TKTools.Color.Red);
        }
    }
예제 #4
0
    void UpdateMesh()
    {
        MeshDesign design = Program.meshDesigner.CurrentDesign;

        if (design.Tile == null)
        {
            selectModel.Texture = null;
        }
        else
        {
            TextureSet.Tile tile = design.Tile;
            SYS.RectangleF  rect = tile.UV;

            selectModel.VertexUV = new Vector2[] {
                new Vector2(rect.X, rect.Y),
                new Vector2(rect.X + rect.Width, rect.Y),
                new Vector2(rect.X + rect.Width, rect.Y + rect.Height),
                new Vector2(rect.X, rect.Y + rect.Height)
            };
            selectModel.Texture = tile.Texture;
        }
    }
예제 #5
0
 public EMesh(RectangleF rect, MeshDesign design, Layer l, Editor e)
     : this(l, e)
 {
     SetVertices(rect);
     Design = design;
 }