mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-30 02:56:44 +00:00 
			
		
		
		
	Fix the secondary navigation method for OrbitCameraController.
This commit is contained in:
		
							parent
							
								
									3c83128abc
								
							
						
					
					
						commit
						dede171886
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		|  | @ -520,8 +520,14 @@ namespace CSVRender | ||||||
| 
 | 
 | ||||||
|     void OrbitCameraController::translate(const osg::Vec3d& offset) |     void OrbitCameraController::translate(const osg::Vec3d& offset) | ||||||
|     { |     { | ||||||
|         mCenter += offset; |         osg::Vec3d eye, center, up; | ||||||
|         getCamera()->getViewMatrix() *= osg::Matrixd::translate(offset); |         getCamera()->getViewMatrixAsLookAt(eye, center, up); | ||||||
|  | 
 | ||||||
|  |         osg::Vec3d newOffset = getCamera()->getViewMatrix().getRotate().inverse() * offset; | ||||||
|  |         mCenter += newOffset; | ||||||
|  |         eye += newOffset; | ||||||
|  | 
 | ||||||
|  |         getCamera()->setViewMatrixAsLookAt(eye, mCenter, up); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void OrbitCameraController::zoom(double value) |     void OrbitCameraController::zoom(double value) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue