public override void Update(GameTime gameTime) { base.Update(gameTime); currentMouseState = Mouse.GetState(); _camera = Camera.ActiveCamera; _mousePosition.X = currentMouseState.X; _mousePosition.Y = currentMouseState.Y; }
public Camera(Game game) : base(game) { if (_activeCamera == null) _activeCamera = this; int centerX = Game.Window.ClientBounds.Width / 2; int centerY = Game.Window.ClientBounds.Height / 2; Mouse.SetPosition(centerX, centerY); float ratio = Game.GraphicsDevice.Viewport.AspectRatio; _projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, ratio, 1.0f, 1000.0f); }
public PositionUtility(BlockSimulatorGame game, float x, float y) : base(game, x, y) { _game = game; _camera = Camera.ActiveCamera; }