コード例 #1
0
 public CameraManager(ChaseCamera chaseCamera, FreeCamera freeCamera, CameraType initialSelectedCamera)
 {
     _chaseCamera    = chaseCamera;
     _freeCamera     = freeCamera;
     SelectedCamera  = initialSelectedCamera;
     _lastMouseState = Mouse.GetState();
 }
コード例 #2
0
        private void UpdateChaseCamera(ChaseCamera camera, CustomModel targetModel)
        {
            // Move camera position and rotation relative to box
            camera.Move(targetModel.Position, Vector3.Zero);

            // Update camera
            camera.Update();
        }
コード例 #3
0
        private static void LoadCamera(ContentManager content)
        {
            // Create new cameras
            ChaseCamera chaseCamera = new ChaseCamera(new Vector3(0, 100f, 30f), Vector3.Zero, Vector3.Zero, _graphics)
            {
                Springiness = 1
            };

            chaseCamera.Move(Vector3.Zero, Vector3.Zero);
            FreeCamera freeCamera = new FreeCamera(_graphics, 0f, 0f, new Vector3(10f));

            _cameraManager = new CameraManager(chaseCamera, freeCamera, CameraType.Chase);
        }