示例#1
0
        private float _timeSinceLastFrameLastUpdate; // Time value passed to the last call of the method "Update"

        #endregion Fields

        #region Constructors

        public CameraControlSystem(SceneManager sceneManager, string name, Camera camera = null, bool reCalcOnTargetMoving = true)
        {
            _sceneMgr = sceneManager;
            _name = name;
            _targetNode = null;
            _targetNodeListener = null;
            _recalcOnTargetMoving = reCalcOnTargetMoving;
            _currentCameraMode = null;

            _cameraNode = _sceneMgr.RootSceneNode.CreateChildSceneNode(_name + "SceneNode");

            if (camera == null) {
                _camera = _sceneMgr.CreateCamera(_name);
                _isOwnCamera = true;
            } else {
                _camera = camera;
                _isOwnCamera = false;
            }

            //Reset to default parameters
            _camera.Position = Vector3.ZERO;
            _camera.Orientation = Quaternion.IDENTITY;

            // ... and attach the Ogre camera to the camera node
            _cameraNode.AttachObject(_camera);

            _cameraModes = new Dictionary<string, CameraMode>();
        }
示例#2
0
 public virtual void DeleteCameraModes()
 {
     foreach (var mCameraMode in _cameraModes)
     {
         mCameraMode.Value.Dispose();
     }
     _cameraModes.Clear();
     _currentCameraMode = null;
 }
示例#3
0
        public string GetCameraModeName(CameraMode cameraMode)
        {
            foreach (var pair in _cameraModes)
            {
                if (pair.Value == cameraMode)
                {
                    return(pair.Key);
                }
            }

            return("");
        }
示例#4
0
        public CameraControlSystem(SceneManager sceneManager, string name, SceneNode customCameraSceneNode, bool reCalcOnTargetMoving = true)
        {
            _sceneMgr             = sceneManager;
            _name                 = name;
            _targetNode           = null;
            _targetNodeListener   = null;
            _recalcOnTargetMoving = reCalcOnTargetMoving;
            _currentCameraMode    = null;

            _cameraNode  = _sceneMgr.RootSceneNode.CreateChildSceneNode(_name + "SceneNode");
            _isOwnCamera = false;
            _cameraNode.AddChild(customCameraSceneNode);

            _cameraModes = new Dictionary <string, CameraMode>();
        }
示例#5
0
        public CameraControlSystem(SceneManager sceneManager, string name, SceneNode customCameraSceneNode, bool reCalcOnTargetMoving = true)
        {
            _sceneMgr = sceneManager;
            _name = name;
            _targetNode = null;
            _targetNodeListener = null;
            _recalcOnTargetMoving = reCalcOnTargetMoving;
            _currentCameraMode = null;

            _cameraNode = _sceneMgr.RootSceneNode.CreateChildSceneNode(_name + "SceneNode");
            _isOwnCamera = false;
            _cameraNode.AddChild(customCameraSceneNode);

            _cameraModes = new Dictionary<string, CameraMode>();
        }
示例#6
0
 public void RegisterCameraMode(string name, CameraMode cameraMode)
 {
     _cameraModes[name] = cameraMode;
 }
示例#7
0
 public void RemoveCameraMode(CameraMode cameraMode)
 {
     _cameraModes.Remove(GetCameraModeName(cameraMode));
 }
示例#8
0
 public void RemoveCameraMode(CameraMode cameraMode)
 {
     _cameraModes.Remove(GetCameraModeName(cameraMode));
 }
示例#9
0
 public void RegisterCameraMode(string name, CameraMode cameraMode)
 {
     _cameraModes[name] = cameraMode;
 }
示例#10
0
        public string GetCameraModeName(CameraMode cameraMode)
        {
            foreach (var pair in _cameraModes) {
                if (pair.Value == cameraMode) {
                    return pair.Key;
                }
            }

            return "";
        }
示例#11
0
 public virtual void DeleteCameraModes()
 {
     foreach (var mCameraMode in _cameraModes) {
         mCameraMode.Value.Dispose();
     }
     _cameraModes.Clear();
     _currentCameraMode = null;
 }