feat: add switch between fly and walk

This commit is contained in:
2026-04-05 21:13:55 +08:00
parent ae914a944c
commit 061b72b740
2 changed files with 46 additions and 16 deletions

View File

@@ -15,7 +15,9 @@ class Player {
private:
constexpr static float ACCELERATION = 10.0f;
constexpr static float DECELERATION = 15.0f;
constexpr static float G = 22.5f;
constexpr static float G = 22.5f;
constexpr static float MAX_SPACE_ON_TIME = 0.3f;
float m_yaw = 0.0f;
float m_pitch = 0.0f;
@@ -25,6 +27,11 @@ private:
float max_speed = 7.5f;
float y_speed = 0.0f;
bool can_up = true;
float space_on_time = 0.0f;
bool space_on = false;
bool is_fly = false;
float speed = 0;
glm::vec3 direction = glm::vec3(0.0f, 0.0f, 0.0f);