Esempio n. 1
0
 private static Vector2 ComputeClipDimension(CameraComponent cameraComponent)
 {
     if (cameraComponent.CameraIsWiderThanScreen())
     {
         var scaleFactor = cameraComponent.ScreenWidth / cameraComponent.ViewRectangle.X;
         return(new Vector2(cameraComponent.ScreenWidth, cameraComponent.ViewRectangle.Y * scaleFactor));
     }
     else
     {
         var scaleFactor = cameraComponent.ScreenHeight / cameraComponent.ViewRectangle.Y;
         return(new Vector2(cameraComponent.ViewRectangle.X * scaleFactor, cameraComponent.ScreenHeight));
     }
 }