17cupsofcoffee / tetra

🎮 A simple 2D game framework written in Rust
MIT License
920 stars 63 forks source link

Camera matrix is incorrect until first update #202

Closed 17cupsofcoffee closed 4 years ago

17cupsofcoffee commented 4 years ago

Summary: Until Camera::update is called for the first time, Camera::as_matrix will return an identity matrix.

Steps to reproduce:

  1. Create a new camera.
  2. Call graphics::set_transform_matrix with the camera's matrix.
  3. The view is unchanged.

Expected behavior: The initial matrix should be calculated when the Camera is constructed.