mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
TouchControls: Take FOV into account for camera movement (#15936)
This commit is contained in:
parent
fbc525d683
commit
b0bc6ce637
1 changed files with 4 additions and 2 deletions
|
@ -2407,8 +2407,10 @@ f32 Game::getSensitivityScaleFactor() const
|
||||||
void Game::updateCameraOrientation(CameraOrientation *cam, float dtime)
|
void Game::updateCameraOrientation(CameraOrientation *cam, float dtime)
|
||||||
{
|
{
|
||||||
if (g_touchcontrols) {
|
if (g_touchcontrols) {
|
||||||
cam->camera_yaw += g_touchcontrols->getYawChange();
|
// User setting is already applied by TouchControls.
|
||||||
cam->camera_pitch += g_touchcontrols->getPitchChange();
|
f32 sens_scale = getSensitivityScaleFactor();
|
||||||
|
cam->camera_yaw += g_touchcontrols->getYawChange() * sens_scale;
|
||||||
|
cam->camera_pitch += g_touchcontrols->getPitchChange() * sens_scale;
|
||||||
} else {
|
} else {
|
||||||
v2s32 center(driver->getScreenSize().Width / 2, driver->getScreenSize().Height / 2);
|
v2s32 center(driver->getScreenSize().Width / 2, driver->getScreenSize().Height / 2);
|
||||||
v2s32 dist = input->getMousePos() - center;
|
v2s32 dist = input->getMousePos() - center;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue