Beispiel #1
0
        protected override void OnKeyDown(OpenTK.Input.KeyboardKeyEventArgs e)
        {
            base.OnKeyDown(e);

            if (e.Key == OpenTK.Input.Key.Q)
            {
                mode++;
                if (mode > 3)
                {
                    mode = 0;
                }
            }
            if (e.Key == OpenTK.Input.Key.Tab)
            {
                wm.AddWaypoint(cameraLocation + (rtLocation * 6));
            }

            if (e.Key == OpenTK.Input.Key.Tilde)
            {
                //Add a box to the scene
                physics_world.AddDynamicGeometry(
                    Box.AttachedObject,
                    Matrix4.CreateTranslation(cameraLocation),
                    Box);
            }
            if (e.Key == OpenTK.Input.Key.Escape)
            {
                this.Exit();
                Application.Exit();
            }
            if (e.Alt && e.Key == OpenTK.Input.Key.Enter)
            {
                if (!(this.WindowState == WindowState.Fullscreen))
                {
                    this.WindowBorder = WindowBorder.Hidden;
                    this.WindowState  = WindowState.Fullscreen;
                }
                else
                {
                    this.WindowBorder = WindowBorder.Resizable;
                    this.WindowState  = WindowState.Normal;
                }
            }
        }