refactor(camera): 移除相机跟随的线性插值逻辑

直接使用目标位置作为焦点,简化相机跟随实现
This commit is contained in:
2026-04-05 11:23:50 +08:00
parent dd67577c80
commit c4eefab70c
2 changed files with 1 additions and 4 deletions

View File

@@ -46,7 +46,6 @@ private:
bool initialized_ = false;
float zoom_ = 1.2f;
float followLerpSpeed_ = 8.0f;
float debugMoveSpeed_ = 800.0f;
};

View File

@@ -89,9 +89,7 @@ void GameCameraController::Update(float deltaTime) {
}
if (target_) {
Vec2 targetFocus = target_->GetPosition();
float t = std::clamp(deltaTime * followLerpSpeed_, 0.0f, 1.0f);
focus_ = focus_ + (targetFocus - focus_) * t;
focus_ = target_->GetPosition();
} else if (debugEnabled_) {
updateDebugInput(deltaTime);
}