Ejemplo n.º 1
0
 public void Update()
 {
     if (InputHandler.Get().LockedMouse)
     {
         UpdateMouse();
         UpdateKeyboard();
     }
 }
Ejemplo n.º 2
0
        private void UpdateMouse()
        {
            float      rotationSpeed     = 0.001f;
            MouseState currentMouseState = InputHandler.Get().MouseState;

            float xDifference = currentMouseState.X;
            float yDifference = currentMouseState.Y;

            this.leftrightRot += rotationSpeed * xDifference;
            this.updownRot    -= rotationSpeed * yDifference;
            this.UpdateViewMatrix();
        }
Ejemplo n.º 3
0
        private void UpdateKeyboard()
        {
            KeyboardState keyState = InputHandler.Get().KeyboardState;

            if (keyState.IsPressed(Key.Up))
            {
                this.AddToCameraPosition(new Vector3(0, 0, -1));
            }
            if (keyState.IsPressed(Key.Down))
            {
                this.AddToCameraPosition(new Vector3(0, 0, 1));
            }
            if (keyState.IsPressed(Key.Right))
            {
                this.AddToCameraPosition(new Vector3(-1, 0, 0));
            }
            if (keyState.IsPressed(Key.Left))
            {
                this.AddToCameraPosition(new Vector3(1, 0, 0));
            }
        }
Ejemplo n.º 4
0
 public virtual void Update(Timer timer)
 {
     InputHandler.Get().Update();
 }