1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02:00

TouchControls: Take FOV into account for camera movement (#15936)

This commit is contained in:
grorp
2025-03-28 07:43:59 -04:00
committed by GitHub
parent fbc525d683
commit b0bc6ce637

View File

@@ -2407,8 +2407,10 @@ f32 Game::getSensitivityScaleFactor() const
void Game::updateCameraOrientation(CameraOrientation *cam, float dtime)
{
if (g_touchcontrols) {
cam->camera_yaw += g_touchcontrols->getYawChange();
cam->camera_pitch += g_touchcontrols->getPitchChange();
// User setting is already applied by TouchControls.
f32 sens_scale = getSensitivityScaleFactor();
cam->camera_yaw += g_touchcontrols->getYawChange() * sens_scale;
cam->camera_pitch += g_touchcontrols->getPitchChange() * sens_scale;
} else {
v2s32 center(driver->getScreenSize().Width / 2, driver->getScreenSize().Height / 2);
v2s32 dist = input->getMousePos() - center;