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); }
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); }
public override bool OnMouseMove(OpenGL gl, MouseEventArgs e) { Click click = new Click(gl, e); return base.OnMouseMove (gl, e); }
public virtual void Remove(Click value) { List.Remove(value); }
public virtual void Add(Click value) { List.Add(value); }
public override bool OnMouseMove(OpenGL gl, MouseEventArgs e) { Click click = new Click(gl, e); return(base.OnMouseMove(gl, e)); }