Esempio n. 1
0
    public bool Paint(P3D_Brush brush, Vector2 uv)
    {
        if (this.Canvas == null)
        {
            return(false);
        }
        Vector2 vector = P3D_Helper.CalculatePixelFromCoord(uv, this.Tiling, this.Offset, this.Canvas.width, this.Canvas.height);

        return(this.Paint(brush, vector.x, vector.y));
    }
Esempio n. 2
0
    // This causes the current paint operation to get applied to the specified u/v coordinate
    public bool Paint(P3D_Brush brush, Vector2 uv)
    {
        if (Canvas != null)
        {
            var xy = P3D_Helper.CalculatePixelFromCoord(uv, Tiling, Offset, Canvas.width, Canvas.height);

            return(Paint(brush, xy.x, xy.y));
        }
        return(false);
    }
Esempio n. 3
0
    private void ShowBrushPreview(P3D_Result result)
    {
        var width      = currentTexture.width;
        var height     = currentTexture.height;
        var uv         = result.GetUV(P3D_CoordType.UV1);
        var xy         = P3D_Helper.CalculatePixelFromCoord(uv, CurrentTiling, CurrentOffset, width, height);
        var matrix     = P3D_Helper.CreateMatrix(xy + new Vector2(0.01f, 0.01f), currentBrush.Size * 0.999f, currentBrush.Angle).Inverse;
        var resolution = new Vector2(width, height);

        P3D_BrushPreview.Show(lockedMesh, currentMaterialIndex, lockedGameObject.transform, previewBrushOpacity, matrix, resolution, currentBrush.Shape, CurrentTiling, CurrentOffset);
    }