Esempio n. 1
0
        public override void Update(GameTime gameTime, Camera camera)
        {
            ArcBallCamera cam = camera as ArcBallCamera;

            if (cam == null)
            {
                return;
            }

            if (InputManager.IsKeyDown(Keys.W))
            {
                cam.Pitch += (float)gameTime.ElapsedGameTime.TotalSeconds * 20f;
            }
            if (InputManager.IsKeyDown(Keys.S))
            {
                cam.Pitch -= (float)gameTime.ElapsedGameTime.TotalSeconds * 20f;
            }
            if (InputManager.IsKeyDown(Keys.D))
            {
                cam.Yaw += (float)gameTime.ElapsedGameTime.TotalSeconds * 30f;
            }
            if (InputManager.IsKeyDown(Keys.A))
            {
                cam.Yaw -= (float)gameTime.ElapsedGameTime.TotalSeconds * 30f;
            }
            if (InputManager.IsKeyDown(Keys.Q))
            {
                cam.Distance += (float)gameTime.ElapsedGameTime.TotalSeconds * 3f;
            }
            if (InputManager.IsKeyDown(Keys.E))
            {
                cam.Distance -= (float)gameTime.ElapsedGameTime.TotalSeconds * 3f;
            }
            cam.Distance += InputManager.GetScrollDelta() * 0.005f;
        }
Esempio n. 2
0
        public string Choice;         //Might not need if I can get Entity to work

        public override void Update(GameTime gameTime, Camera camera)
        {
            base.Update(gameTime, camera);

            ArcBallCamera cam = camera as ArcBallCamera;

            if (cam == null)
            {
                return;
            }

            cam.Target = (Entity != null) ? new Vector3(Entity.Position.X / 10, 0, Entity.Position.Y / 10) : Vector3.Zero;
        }