mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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:
parent
5cfb0817ed
commit
b70f08d14f
4 changed files with 26 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue