示例#1
0
 public virtual void Update(TimeInfo timeInfo)
 {
 }
示例#2
0
        private void UpdateCamera(TimeInfo timeInfo)
        {
            const float cameraSpeed = 4f;
            const float cameraSensitivity = 0.002f;

            var deltaTime = (float)timeInfo.Elapsed;

            if (InputManager.IsKeyPressed(Key.W))
                camera.Move(deltaTime * cameraSpeed);
            if (InputManager.IsKeyPressed(Key.S))
                camera.Move(-deltaTime * cameraSpeed);
            if (InputManager.IsKeyPressed(Key.A))
                camera.Strafe(-deltaTime * cameraSpeed);
            if (InputManager.IsKeyPressed(Key.D))
                camera.Strafe(deltaTime * cameraSpeed);

            Vector2 delta = new Vector2(InputManager.MouseX, InputManager.MouseY) - GetScreenCenter();
            camera.RotateX(-delta.Y * cameraSensitivity);
            camera.RotateY(-delta.X * cameraSensitivity);
            SetupMouseToScreenCenter();
        }
 protected virtual void Render(TimeInfo timeInfo)
 {
 }
示例#4
0
        protected override void Update(TimeInfo timeInfo)
        {
            UpdateCamera(timeInfo);

            Renderer.WindowCaption = string.Format("FPS: {0}", Timer.FramesPerSecond);
        }
 protected virtual void Update(TimeInfo timeInfo)
 {
 }