feat: add run and walk gait

This commit is contained in:
2026-04-05 21:47:32 +08:00
parent 061b72b740
commit 82f0e1deae
7 changed files with 51 additions and 9 deletions

View File

@@ -138,7 +138,7 @@ void App::run() {
}
}
static Gait player_gait = Gait::WALK;
void App::update() {
glfwPollEvents();
current_time = glfwGetTime();
@@ -155,7 +155,16 @@ void App::update() {
}
m_world.update(delta_time);
m_camera.update_move_camera();
const auto& player= m_world.get_player("TestPlayer");
if (player_gait != player.get_gait()) {
player_gait = player.get_gait();
if (player_gait == Gait::WALK) {
m_renderer.update_fov(NORMAL_FOV);
}
if (player_gait == Gait::RUN) {
m_renderer.update_fov(NORMAL_FOV + 3.0f);
}
}
}