Ejemplo n.º 1
0
 void _editor_TerrainColor_Changed(object sender, TerrainArgs e)
 {
     _heightMap._color0 = e.Color0;
     _heightMap._color1 = e.Color1;
     _heightMap._color2 = e.Color2;
     _heightMap._color3 = e.Color3;
 }
Ejemplo n.º 2
0
        private void terrainHeight_ValueChanged(object sender, EventArgs e)
        {
            // make a copy to be more thread-safe
            EventHandler <TerrainArgs> handler = TerrainHeightChanged;

            if (handler != null)
            {
                TerrainArgs args = new TerrainArgs();
                args.Height = Convert.ToInt32(terrainHeight.Value);
                handler(this, args);
            }
        }
Ejemplo n.º 3
0
        private void contours_Changed(object sender, EventArgs e)
        {
            contourSpacing.Enabled = contours.Checked;

            EventHandler <TerrainArgs> handler = TerrainContoursChanged;

            if (handler != null)
            {
                TerrainArgs args = new TerrainArgs();
                args.DisplayContours = contours.Checked;
                args.ContourSpacing  = (float)Convert.ToDouble(contourSpacing.Value);
                handler(this, args);
            }
        }
Ejemplo n.º 4
0
        private void color1_Click(object sender, EventArgs e)
        {
            ColorDialog dialog = new ColorDialog();

            dialog.ShowDialog();

            EventHandler <TerrainArgs> handler = TerrainColorChanged;

            if (handler != null)
            {
                TerrainArgs args = new TerrainArgs();
                args.Height = Convert.ToInt32(terrainHeight.Value);

                color1.FillColor = dialog.Color;
                args.Color0      = new Vector4(color0.FillColor.R / 255.0f, color0.FillColor.G / 255.0f, color0.FillColor.B / 255.0f, 1.0f);
                args.Color1      = new Vector4(color1.FillColor.R / 255.0f, color1.FillColor.G / 255.0f, color1.FillColor.B / 255.0f, 1.0f);
                args.Color2      = new Vector4(color2.FillColor.R / 255.0f, color2.FillColor.G / 255.0f, color2.FillColor.B / 255.0f, 1.0f);
                args.Color3      = new Vector4(color3.FillColor.R / 255.0f, color3.FillColor.G / 255.0f, color3.FillColor.B / 255.0f, 1.0f);

                handler(this, args);
            }
        }
Ejemplo n.º 5
0
 void _editor_TerrainContour_Changed(object sender, TerrainArgs e)
 {
     _heightMap._displayContours = e.DisplayContours;
     _heightMap._contourSpacing  = e.ContourSpacing;
 }
Ejemplo n.º 6
0
 void _editor_TerrainHeight_Changed(object sender, TerrainArgs e)
 {
     _heightMap._heightScale = (float)e.Height;
 }