private void glControl_MouseUp(object sender, MouseEventArgs e) { if (clickMousePos.X == e.Location.X && clickMousePos.Y==e.Location.Y) { if (e.Button == MouseButtons.Left ) { Vector3 dir = camera.ScreenPosToRay(e.Location.X, e.Location.Y); SelectItem(camera.Position, dir, (ModifierKeys & Keys.Control) != 0); glControl.Refresh(); } if (e.Button == MouseButtons.Right) ShowContextMenu(e.Location); } movingAnchor = null; }
private void openGLControl_MouseDown(object sender, MouseEventArgs e) { lastMousePos = e.Location; clickMousePos = e.Location; if (Highlighted is MoveAnchorArrow && e.Button == MouseButtons.Left) movingAnchor = (MoveAnchorArrow)Highlighted; }
MoveAnchorArrow[] GetMoveAnchors(Vector3 pos) { float s=0.1f, e=0.6f; MoveAnchorArrow[] r = new MoveAnchorArrow[3]; for (int a = 0; a < 3; a++) r[a] = new MoveAnchorArrow(pos + s * AxisVector[a], pos + e * AxisVector[a]) { axis = a }; return r; }