Ejemplo n.º 1
0
 public ICameraController ActiveCameraControllerForView()
 {
     var camMode = _camMode;
     if (_cameraImpls[(int)camMode] == null)
     {
         switch (camMode)
         {
             case CameraMode.Fps:
                 _cameraImpls[(int)camMode] = new FpsCameraController();
                 break;
             case CameraMode.X:
             case CameraMode.Y:
             case CameraMode.Z:
             case CameraMode.Orbit:
                 var orbit = new OrbitCameraController(camMode);
                 _cameraImpls[(int)CameraMode.X] = orbit;
                 _cameraImpls[(int)CameraMode.Y] = orbit;
                 _cameraImpls[(int)CameraMode.Z] = orbit;
                 _cameraImpls[(int)CameraMode.Orbit] = orbit;
                 break;
             case CameraMode.Pick:
                 _cameraImpls[(int)camMode] = new PickingCameraController();
                 break;
             default:
                 Debug.Assert(false);
                 break;
         }
     }
     return _cameraImpls[(int)camMode];
 }
Ejemplo n.º 2
0
        public ICameraController ActiveCameraControllerForView()
        {
            var camMode = _camMode;

            if (_cameraImpls[(int)camMode] == null)
            {
                switch (camMode)
                {
                case CameraMode.Fps:
                    _cameraImpls[(int)camMode] = new FpsCameraController(_fovy, _scenePartMode);
                    break;

                case CameraMode.X:
                case CameraMode.Y:
                case CameraMode.Z:
                case CameraMode.Orbit:
                    var orbit = new OrbitCameraController(camMode, _fovy, _scenePartMode);
                    _cameraImpls[(int)CameraMode.X]     = orbit;
                    _cameraImpls[(int)CameraMode.Y]     = orbit;
                    _cameraImpls[(int)CameraMode.Z]     = orbit;
                    _cameraImpls[(int)CameraMode.Orbit] = orbit;
                    break;

                case CameraMode.HMD:
                case CameraMode.Cont1:
                case CameraMode.Cont2:
                    var vrcont = new PickingCameraController(camMode, _fovy, _scenePartMode);
                    _cameraImpls[(int)CameraMode.HMD]   = vrcont;
                    _cameraImpls[(int)CameraMode.Cont1] = vrcont;
                    _cameraImpls[(int)CameraMode.Cont2] = vrcont;
                    break;

                default:
                    Debug.Assert(false);
                    break;
                }
            }
            return(_cameraImpls[(int)camMode]);
        }
Ejemplo n.º 3
0
 public ICameraController ActiveCameraControllerForView()
 {
     var camMode = _camMode;
     if (_cameraImpls[(int)camMode] == null)
     {
         switch (camMode)
         {
             case CameraMode.Fps:
                 _cameraImpls[(int)camMode] = new FpsCameraController();
                 break;
             case CameraMode.X:
             case CameraMode.Y:
             case CameraMode.Z:
             case CameraMode.Orbit:
                 var orbit = new OrbitCameraController(camMode);
                 _cameraImpls[(int)CameraMode.X] = orbit;
                 _cameraImpls[(int)CameraMode.Y] = orbit;
                 _cameraImpls[(int)CameraMode.Z] = orbit;
                 _cameraImpls[(int)CameraMode.Orbit] = orbit;
                 break;
             case CameraMode.Pick:
                 _cameraImpls[(int)camMode] = new PickingCameraController();
                 break;
             default:
                 Debug.Assert(false);
                 break;
         }
     }
     return _cameraImpls[(int)camMode];
 }