[Fix] Accidently removed rotation of local player.
This commit is contained in:
parent
e35c4b5d61
commit
c5a722b047
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user