UEXDev

Camera ViewPlane

May 28th, 2012
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. public Rectangle ViewPlane { get; private set; }
  2.  
  3. public override void Update(GameTime gameTime)
  4. {
  5.     if (!updateViewRequired) return;
  6.  
  7.     View = translationMatrix *
  8.             rotationMatrix *
  9.             scaleMatrix *
  10.             focusPointMatrix;
  11.  
  12.     ViewPlane = new Rectangle(
  13.         (int)(Position.X - (zoomWidth * 0.5)),
  14.         (int)(Position.Y - (zoomHeight * 0.5)),
  15.         zoomWidth,
  16.         zoomHeight);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment