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>(); }
public virtual void DeleteCameraModes() { foreach (var mCameraMode in _cameraModes) { mCameraMode.Value.Dispose(); } _cameraModes.Clear(); _currentCameraMode = null; }
public string GetCameraModeName(CameraMode cameraMode) { foreach (var pair in _cameraModes) { if (pair.Value == cameraMode) { return(pair.Key); } } return(""); }
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>(); }
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>(); }
public void RegisterCameraMode(string name, CameraMode cameraMode) { _cameraModes[name] = cameraMode; }
public void RemoveCameraMode(CameraMode cameraMode) { _cameraModes.Remove(GetCameraModeName(cameraMode)); }
public string GetCameraModeName(CameraMode cameraMode) { foreach (var pair in _cameraModes) { if (pair.Value == cameraMode) { return pair.Key; } } return ""; }