diff --git a/addons/spectator/functions/fnc_handleCamera.sqf b/addons/spectator/functions/fnc_handleCamera.sqf index 1d1d5bef9e..960a20df80 100644 --- a/addons/spectator/functions/fnc_handleCamera.sqf +++ b/addons/spectator/functions/fnc_handleCamera.sqf @@ -20,12 +20,15 @@ // Kill PFH when not in free cam (or display is closed) if (isNil QGVAR(camHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -private ["_oldPos","_mX","_mY","_mZ","_pan","_x","_y","_z"]; +private ["_oldPos","_zoomMod","_mX","_mY","_mZ","_pan","_x","_y","_z"]; _oldPos = getPosASL GVAR(camera); -_mX = (GVAR(camDolly) select 0) / ((GVAR(camZoom) * 0.8) max 1); -_mY = (GVAR(camDolly) select 1) / ((GVAR(camZoom) * 0.8) max 1); -_mZ = GVAR(camBoom) / ((GVAR(camZoom) * 0.8) max 1); + +// Dolly/Boom amount should be influnced by zoom level (it should really be exponential) +_zoomMod = (GVAR(camZoom) * 0.8) max 1; +_mX = (GVAR(camDolly) select 0) / _zoomMod; +_mY = (GVAR(camDolly) select 1) / _zoomMod; +_mZ = GVAR(camBoom) / _zoomMod; _pan = (GVAR(camPan) + 360) % 360; _x = (_oldPos select 0) + (_mX * cos(_pan)) + (_mY * sin(_pan)); diff --git a/addons/spectator/functions/fnc_handleMouse.sqf b/addons/spectator/functions/fnc_handleMouse.sqf index 8158ba95b5..1c2b62798c 100644 --- a/addons/spectator/functions/fnc_handleMouse.sqf +++ b/addons/spectator/functions/fnc_handleMouse.sqf @@ -18,7 +18,7 @@ #include "script_component.hpp" params ["_x","_y"]; -private ["_leftButton","_rightButton","_oldX","_oldY","_deltaX","_deltaY"]; +private ["_leftButton","_rightButton","_oldX","_oldY","_deltaX","_deltaY","_zoomMod"]; _leftButton = GVAR(mouse) select 0; _rightButton = GVAR(mouse) select 1; @@ -35,8 +35,11 @@ if (_leftButton) then { GVAR(camDolly) set [1, _deltaY * 100 * GVAR(camSpeed)]; } else { if (_rightButton) then { - GVAR(camPan) = GVAR(camPan) - (_deltaX * 360); - GVAR(camTilt) = ((GVAR(camTilt) + (_deltaY * 180)) min 89) max -89; + // Pan/Tilt amount should be influnced by zoom level (it should really be exponential) + _zoomMod = (GVAR(camZoom) * 0.8) max 1; + + GVAR(camPan) = GVAR(camPan) - ((_deltaX * 360) / _zoomMod); + GVAR(camTilt) = ((GVAR(camTilt) + ((_deltaY * 180) / _zoomMod)) min 89) max -89; }; };