Add proportional zoom and reduced default max zoom with extended toggle

Zoom speed now scales with distance for fine control near the character.
Default max zoom out reduced from 50 to 33 units. New "Extended Camera
Zoom" toggle in Gameplay settings restores the full 50-unit range.
This commit is contained in:
Kelsi 2026-02-23 08:09:27 -08:00
parent 5cfb0817ed
commit b70f08d14f
4 changed files with 26 additions and 4 deletions

View file

@ -1678,9 +1678,11 @@ void CameraController::teleportTo(const glm::vec3& pos) {
}
void CameraController::processMouseWheel(float delta) {
// Adjust user's target distance (collision may limit actual distance)
userTargetDistance -= delta * 2.0f; // 2.0 units per scroll notch
userTargetDistance = glm::clamp(userTargetDistance, MIN_DISTANCE, MAX_DISTANCE);
// Scale zoom speed proportionally to current distance for fine control up close
float zoomSpeed = glm::max(userTargetDistance * 0.15f, 0.3f);
userTargetDistance -= delta * zoomSpeed;
float maxDist = extendedZoom_ ? MAX_DISTANCE_EXTENDED : MAX_DISTANCE_NORMAL;
userTargetDistance = glm::clamp(userTargetDistance, MIN_DISTANCE, maxDist);
}
void CameraController::setFollowTarget(glm::vec3* target) {