示例#1
0
        private void mouse_MoveBuffer()
        {
            // Calculate mouse current position
            _game.mouse.position_current = (_game.mouse.locked || _game.mouse.getButtonPress(MouseButton.Left)) ? base.PointToClient(System.Windows.Forms.Cursor.Position) : _game.mouse.position_previous;

            // Don't move game if we are using the tweak bar
            if (!_debug_window.handle_MouseMove(_game.mouse.position_current))
            {
                // Rotate main character from mouse movement
                _game.player.rotate(
                    _game.mouse.position_delta,
                    _game.config.smooth_mouse_delay
                    );

                // Move Picked Object
                Vector3[] picking_vectors = getPickingVectors();
                _physics_driver.moveObject(EngineHelper.otk2bullet(picking_vectors[0]), EngineHelper.otk2bullet(picking_vectors[1]));
            }


            // Recenter
            centerMouse();
        }
示例#2
0
        protected void mouse_ButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (_debug_window.handle_MouseClick(e))
            {
                return;
            }

            _game.mouse.buttonDown(e);
            switch (e.Button)
            {
            case MouseButton.Left:
                Vector3[] picking_vectors = getPickingVectors();
                _physics_driver.pickObject(EngineHelper.otk2bullet(picking_vectors[0]), EngineHelper.otk2bullet(picking_vectors[1]), !_game.keyboard.getKeyPress(Key.AltLeft));
                break;

            case MouseButton.Right:
                //_sound_cow.Play();
                _sound_goat.Play();
                break;

            case MouseButton.Middle:
                _render_driver.triggerScreenshot();
                break;
            }
        }
示例#3
0
        protected void keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
        {
            _game.keyboard.keyDown(e);
            switch (e.Key)
            {
            case Key.F:
                _game.scene.toggleFlashlight(_game.player.toggleFlashlight());
                break;

            case Key.O:
                Thread.Sleep(2000);
                break;

            case Key.P:
                _physics_driver.pause();
                _game.scene.pauseAnimation();
                break;

            case Key.R:
                _physics_driver.reset();
                _game.scene.resetAnimation();
                break;

            case Key.X:
                _physics_driver.throwObject(EngineHelper.otk2bullet(getWorldSpaceRay()));
                break;

            case Key.Z:
                _physics_driver.zoomPickedObject();
                break;

            case Key.Tab:
                _game.player.togglePhysical();
                break;

            case Key.CapsLock:
                _game.mouse.toggleLock();
                if (_game.mouse.locked)
                {
                    centerMouse();
                }
                break;

            case Key.F6:
                _debug_window.toggleTimers();
                break;

            case Key.F7:
                _render_driver.toggleDebugViews();
                break;

            case Key.F8:
                _render_driver.toggleWireframe();
                break;

            case Key.Number7:
            case Key.Keypad7:
                _render_driver.toggleEffect(typeof(Render.FX.fx_VXGI));
                break;

            case Key.Escape:
                Exit();
                break;
            }
        }