コード例 #1
0
ファイル: Builder.cs プロジェクト: nromik/sharpgl
        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);
        }
コード例 #2
0
ファイル: Builder.cs プロジェクト: nromik/sharpgl
        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);
        }
コード例 #3
0
ファイル: Builder.cs プロジェクト: nromik/sharpgl
        public override bool OnMouseMove(OpenGL gl, MouseEventArgs e)
        {
            Click click = new Click(gl, e);

            return base.OnMouseMove (gl, e);
        }
コード例 #4
0
ファイル: Builder.cs プロジェクト: nromik/sharpgl
 public virtual void Remove(Click value)
 {
     List.Remove(value);
 }
コード例 #5
0
ファイル: Builder.cs プロジェクト: nromik/sharpgl
 public virtual void Add(Click value)
 {
     List.Add(value);
 }
コード例 #6
0
 public virtual void Remove(Click value)
 {
     List.Remove(value);
 }
コード例 #7
0
 public virtual void Add(Click value)
 {
     List.Add(value);
 }
コード例 #8
0
        public override bool OnMouseMove(OpenGL gl, MouseEventArgs e)
        {
            Click click = new Click(gl, e);

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