Exemple #1
0
        private void scenePanel_MouseUp(object sender, MouseEventArgs e)
        {
            cameraCapture = CameraCaptureState.None;
            this.Cursor   = Cursors.Default;

            if (e.Button == MouseButtons.Left)
            {
                selectionCursor.Position = highlightingCursor.Position;
                selectionCursor.Visible  = highlightingCursor.Visible;
            }
        }
        private void canvas_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left &&
                cameraCapture == CameraCaptureState.None)
            {
                if (life is Life)
                {
                    PokeLifeAt(e.Location, null);
                }
                //else if (life is Life3D)
                //    lifeCursor.Poke(null);
            }

            cameraCapture = CameraCaptureState.None;
            this.Cursor   = Cursors.Default;
        }
Exemple #3
0
        private void canvas_MouseUp(object sender, MouseEventArgs e)
        {
            if (cameraCapture == CameraCaptureState.None)
            {
                if (!wasFirstClick)
                {
                    if (cube.FindSideByPoint(e.Location, canvas.Scene,
                                             Matrix.Identity, out firstCoords, out firstSide))
                    {
                        wasFirstClick = true;

                        Vector3 cubePosition = CoordsHelper.GetPositionFromCoords(
                            firstCoords, cube.Size);

                        // move cursor by half size of small cube
                        cubePosition += CoordsHelper.GetNormalFromSide(firstSide) / cube.Size;
                        cubePosition  = Vector3.Transform(cubePosition, ref cube.World);

                        rotationCursor.Position = cubePosition;
                        cursorVisible           = true;
                    }
                }
                else
                {
                    CubeCoords secondCoords;
                    CubeSide   secondSide;

                    if (cube.FindSideByPoint(e.Location, canvas.Scene,
                                             Matrix.Identity, out secondCoords, out secondSide))
                    {
                        Rotation rotation = cube.CreateRotationFromSides(
                            firstCoords, firstSide, secondCoords, secondSide);

                        if (rotation != null)
                        {
                            rotationsToApply.Enqueue(rotation);
                        }

                        wasFirstClick = false;
                        cursorVisible = false;
                    }
                }
            }

            cameraCapture = CameraCaptureState.None;
            this.Cursor   = Cursors.Default;
        }
Exemple #4
0
        private void canvas_MouseDown(object sender, MouseEventArgs e)
        {
            if (cameraCapture != CameraCaptureState.None)
            {
                return;
            }

            mousePosition = e.Location;

            if (e.Button == MouseButtons.Middle)
            {
                cameraCapture = CameraCaptureState.Move;
                this.Cursor   = Cursors.SizeAll;
            }
            else if (e.Button == MouseButtons.Right)
            {
                cameraCapture = CameraCaptureState.Rotate;
                this.Cursor   = Cursors.Cross;
            }
        }
Exemple #5
0
 private void panelGraphics_MouseUp(object sender, MouseEventArgs e)
 {
     cameraCapture = CameraCaptureState.None;
     this.Cursor   = Cursors.Default;
 }