示例#1
0
        private void UpdateCameras(GameTime gameTime)
        {
            oldms = newms;
            newms = Mouse.GetState();

            if (IsActive && newms.X >= 0 && newms.Y >= 0 && newms.LeftButton == ButtonState.Pressed)
            {
                IsMouseVisible = false;
                updatemouse    = true;
                Mouse.SetPosition(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);
            }
            else
            {
                IsMouseVisible = true;
                updatemouse    = false;
            }

            skycamera.Update(gameTime, updatemouse, false, newms, oldms);
            camera.Update(gameTime, updatemouse, true, newms, oldms);

            rightCamera.Position      = camera.Position + Vector3.Transform(Vector3.Left * settings.StereoPairSeparation / 100f, Matrix.CreateFromYawPitchRoll(camera.leftRightRot, camera._upDownRot, 0));
            rightCamera.rotationSpeed = camera.rotationSpeed;
            rightCamera.Target        = camera.Target;
            rightCamera.Update(gameTime, updatemouse, true, newms, oldms);

            leftCamera.Position      = camera.Position + Vector3.Transform(Vector3.Right * settings.StereoPairSeparation / 100f, Matrix.CreateFromYawPitchRoll(camera.leftRightRot, camera._upDownRot, 0));
            leftCamera.rotationSpeed = camera.rotationSpeed;
            leftCamera.Target        = camera.Target;
            leftCamera.Update(gameTime, updatemouse, true, newms, oldms);
        }
示例#2
0
        private void EnableLodCamera()
        {
            lodEnabled = true;

            /*
             * camera.NearClip = 1f;
             * camera.FarClip = 10000f;
             * lowcamera.NearClip = 9000f;
             * lowcamera.FarClip = 50000f;
             */
            lowcamera.NearClip = 1f;
            lowcamera.FarClip  = 100000f;
            camera.NearClip    = 1f;
            camera.FarClip     = 2f;

            camera.Update(null);
            lowcamera.Update(null);
        }
示例#3
0
        private void UpdateCameras(GameTime gameTime)
        {
            oldms = newms;
            newms = Mouse.GetState();

            if (IsActive && newms.X >= 0 && newms.Y >= 0 && newms.LeftButton == ButtonState.Pressed)
            {
                IsMouseVisible = false;
                updatemouse    = true;
                Mouse.SetPosition(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);
            }
            else
            {
                IsMouseVisible = true;
                updatemouse    = false;
            }

            skycamera.Update(gameTime, updatemouse, false, newms, oldms);
            camera.Update(gameTime, updatemouse, true, newms, oldms);
            lowcamera.Copy(gameTime, camera);

            newms = Mouse.GetState();
        }