* Fixed viewport location bug in RenderManager
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7461 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
		
							parent
							
								
									fb11b4b3ed
								
							
						
					
					
						commit
						bef4a77169
					
				| @ -611,15 +611,19 @@ public class RenderManager { | |||||||
|             cam.clearViewportChanged(); |             cam.clearViewportChanged(); | ||||||
|             prevCam = cam; |             prevCam = cam; | ||||||
| 
 | 
 | ||||||
|  |             float translateX = viewWidth == viewX ? 0 : -(viewWidth + viewX) / (viewWidth - viewX); | ||||||
|  |             float translateY = viewHeight == viewY ? 0 : -(viewHeight + viewY) / (viewHeight - viewY); | ||||||
|  |             float scaleX = viewWidth == viewX ? 1f : 2f / (viewWidth - viewX); | ||||||
|  |             float scaleY = viewHeight == viewY ? 1f : 2f / (viewHeight - viewY); | ||||||
|              |              | ||||||
| //            float translateX = viewWidth == viewX ? 0 : -(viewWidth + viewX) / (viewWidth - viewX); |  | ||||||
| //            float translateY = viewHeight == viewY ? 0 : -(viewHeight + viewY) / (viewHeight - viewY); |  | ||||||
| //            float scaleX = viewWidth == viewX ? 1f : 2f / (viewWidth - viewX); |  | ||||||
| //            float scaleY = viewHeight == viewY ? 1f : 2f / (viewHeight - viewY); |  | ||||||
|             orthoMatrix.loadIdentity(); |             orthoMatrix.loadIdentity(); | ||||||
|             orthoMatrix.setTranslation(-1f, -1f, 0f); |             orthoMatrix.setTranslation(translateX, translateY, 0); | ||||||
|             orthoMatrix.setScale(2f / cam.getWidth(), 2f / cam.getHeight(), 0f); |             orthoMatrix.setScale(scaleX, scaleY, 1);  | ||||||
|             System.out.println(orthoMatrix); |              | ||||||
|  |             //orthoMatrix.loadIdentity(); | ||||||
|  |             //orthoMatrix.setTranslation(-1f, -1f, 0f); | ||||||
|  |             //orthoMatrix.setScale(2f / cam.getWidth(), 2f / cam.getHeight(), 0f); | ||||||
|  |             //System.out.println(orthoMatrix); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user