Exemplo n.º 1
0
        public override bool OnMouseMove(OpenGL gl, MouseEventArgs e)
        {
            //	We only update the radius if the left button is
            //	down, and the buildingObject isn't null.

            Click click = new Click(gl, e);

            if(e.Button == MouseButtons.Left)
            {

                //	If we have clicked once, then we are setting the radius.
                Vertex v = PointToVertexOnPlane(gl, Plane.xz, click.OpenGLx,
                    click.OpenGLy);

                if(v != null)
                {
                    Vertex v2 = clicks[0].vertex;
                    BuildingGrid grid = new BuildingGrid();
                    grid.Clamp(v);
                    grid.Clamp(v2);

                    Vertex between = v - v2;
                    ((Quadrics.Sphere)buildingObject).Radius = between.Magnitude();
                }

                buildingObject.Modified = true;

                return true;
            }

            return base.OnMouseMove (gl, e);
        }
Exemplo n.º 2
0
        public override bool OnMouseMove(OpenGL gl, MouseEventArgs e)
        {
            //	We only update the radius if the left button is
            //	down, and the buildingObject isn't null.
            Polygon plane = (Polygon)buildingObject;
            Click click = new Click(gl, e);

            if(e.Button == MouseButtons.Left)
            {
                //	If we have clicked once, then we are setting the other corner.
                Vertex v = PointToVertexOnPlane(gl, Plane.xz, click.OpenGLx,
                    click.OpenGLy);

                if(v != null)
                {
                    BuildingGrid grid = new BuildingGrid();
                    grid.Clamp(v);

                    Vertex v0 = plane.Vertices[0];
                    Vertex v3 = plane.Vertices[3] = v;

                    plane.Vertices[1].Set(v3.X, 0, v0.Z);
                    plane.Vertices[2].Set(v0.X, 0, v3.Z);

                }

                buildingObject.Modified = true;

                return true;
            }

            return base.OnMouseMove (gl, e);
        }
Exemplo n.º 3
0
        public override bool OnMouseMove(OpenGL gl, MouseEventArgs e)
        {
            Click click = new Click(gl, e);

            return base.OnMouseMove (gl, e);
        }
Exemplo n.º 4
0
 public virtual void Remove(Click value)
 {
     List.Remove(value);
 }
Exemplo n.º 5
0
 public virtual void Add(Click value)
 {
     List.Add(value);
 }
Exemplo n.º 6
0
 public virtual void Remove(Click value)
 {
     List.Remove(value);
 }
Exemplo n.º 7
0
 public virtual void Add(Click value)
 {
     List.Add(value);
 }
Exemplo n.º 8
0
        public override bool OnMouseMove(OpenGL gl, MouseEventArgs e)
        {
            Click click = new Click(gl, e);

            return(base.OnMouseMove(gl, e));
        }