Advertisement
daydrinking

Untitled

Apr 10th, 2024
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1.   >> 16 void Camera2D::update ()
  2.      17 {
  3.      18     if (_change)
  4.      19     {
  5.      20         glm::vec3 translate (-_position.x + _screenWidth / 2, -_position.y + _screenHeight / 2, 0.0f);
  6.      21         _cameraMatrix = glm::translate (_orthoMatrix, translate);
  7.      22
  8.      23         glm::vec3 scale (_scale, _scale, 0.0f);
  9.      24         _cameraMatrix = glm::scale (glm::mat4 (1.0f), scale) * _cameraMatrix;
  10.      25
  11.      26         _change = false;
  12.      27     }
  13.      28 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement