mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-30 02:56:44 +00:00 
			
		
		
		
	Editor: flag orbit camera for re-initialization
After swapping cells the orbit cam controller needs to be re-initialized to properly center on the new cell.
This commit is contained in:
		
							parent
							
								
									f7664d4bb9
								
							
						
					
					
						commit
						84bad9316d
					
				
					 3 changed files with 10 additions and 0 deletions
				
			
		|  | @ -632,6 +632,11 @@ namespace CSVRender | ||||||
|         getCamera()->getViewMatrix().orthoNormal(getCamera()->getViewMatrix()); |         getCamera()->getViewMatrix().orthoNormal(getCamera()->getViewMatrix()); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     void OrbitCameraController::reset() | ||||||
|  |     { | ||||||
|  |         mInitialized = false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     void OrbitCameraController::onActivate() |     void OrbitCameraController::onActivate() | ||||||
|     { |     { | ||||||
|         mInitialized = false; |         mInitialized = false; | ||||||
|  |  | ||||||
|  | @ -159,6 +159,9 @@ namespace CSVRender | ||||||
| 
 | 
 | ||||||
|             void update(double dt); |             void update(double dt); | ||||||
| 
 | 
 | ||||||
|  |             /// \brief Flag controller to be re-initialized.
 | ||||||
|  |             void reset(); | ||||||
|  | 
 | ||||||
|         private: |         private: | ||||||
| 
 | 
 | ||||||
|             void onActivate(); |             void onActivate(); | ||||||
|  |  | ||||||
|  | @ -15,6 +15,7 @@ | ||||||
| #include "../widget/scenetooltoggle.hpp" | #include "../widget/scenetooltoggle.hpp" | ||||||
| #include "../widget/scenetooltoggle2.hpp" | #include "../widget/scenetooltoggle2.hpp" | ||||||
| 
 | 
 | ||||||
|  | #include "cameracontroller.hpp" | ||||||
| #include "mask.hpp" | #include "mask.hpp" | ||||||
| #include "tagbase.hpp" | #include "tagbase.hpp" | ||||||
| 
 | 
 | ||||||
|  | @ -93,6 +94,7 @@ bool CSVRender::UnpagedWorldspaceWidget::handleDrop (const std::vector<CSMWorld: | ||||||
| 
 | 
 | ||||||
|     mCell.reset (new Cell (getDocument().getData(), mRootNode, mCellId)); |     mCell.reset (new Cell (getDocument().getData(), mRootNode, mCellId)); | ||||||
|     mCamPositionSet = false; |     mCamPositionSet = false; | ||||||
|  |     mOrbitCamControl->reset(); | ||||||
| 
 | 
 | ||||||
|     update(); |     update(); | ||||||
|     emit cellChanged(*universalIdData.begin()); |     emit cellChanged(*universalIdData.begin()); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue