[Fix] Accidently removed rotation of local player.

This commit is contained in:
Ritchie Cunningham 2025-09-17 19:25:31 +01:00
parent e35c4b5d61
commit c5a722b047

View File

@ -169,7 +169,11 @@ void Renderer::render(const Camera& camera, const Player& player,
const auto& player_pos = player.get_position(); const auto& player_pos = player.get_position();
BettolaMath::Mat4 trans_matrix = BettolaMath::Mat4::translation(player_pos.x, BettolaMath::Mat4 trans_matrix = BettolaMath::Mat4::translation(player_pos.x,
player_pos.y, player_pos.z); player_pos.y, player_pos.z);
_shader.set_mat4("model", trans_matrix); BettolaMath::Mat4 rot_matrix = BettolaMath::Mat4::rotation(-camera.get_yaw()-90.f,
{0.0f, 1.0f, 0.0f});
BettolaMath::Mat4 model = trans_matrix.multiply(rot_matrix);
_shader.set_mat4("model", model);
GL_CHECK_ERROR(); GL_CHECK_ERROR();
glBindVertexArray(_vao); glBindVertexArray(_vao);