try to make touch camera better

This commit is contained in:
RandomityGuy 2026-03-29 11:05:05 +01:00
parent c6802821e2
commit 1282d42185
2 changed files with 11 additions and 7 deletions

View file

@ -89,20 +89,25 @@ class CameraInput {
if (jumpcam) {
scaleFactor /= Settings.touchSettings.buttonJoystickMultiplier;
}
var inpX = delta.x / scaleFactor;
var inpY = delta.y / scaleFactor;
if (jumpcam) {
if (Math.abs(inpX) < 1)
if (Math.abs(inpX) < 1.3)
inpX = 0;
if (Math.abs(inpY) < 1)
if (Math.abs(inpY) < 1.3)
inpY = 0;
}
MarbleGame.instance.world.marble.camera.orbit(applyNonlinearScale(inpX), applyNonlinearScale(inpY), true);
prevMouse.x = e.relX;
prevMouse.y = e.relY;
var dt = MarbleGame.instance.world.timeState.dt;
MarbleGame.instance.world.marble.camera.orbit(applyNonlinearScale((inpX / dt) * (1 / 60.0)) * (1 / 60.0) * 20,
applyNonlinearScale((inpY / dt) * (1 / 60.0)) * (1 / 60.0) * 20, true);
if (inpX != 0)
prevMouse.x = e.relX;
if (inpY != 0)
prevMouse.y = e.relY;
}
}

View file

@ -13,7 +13,6 @@ class PauseButton extends TouchButton {
this.onClick = () -> {
if (MarbleGame.instance.world != null && @:privateAccess !MarbleGame.instance.paused) {
@:privateAccess MarbleGame.instance.paused = true;
MarbleGame.instance.handlePauseGame();
}
}