From 60a14f884476c8e3a1075dabfaabe1c326576c68 Mon Sep 17 00:00:00 2001 From: Roman Silin Date: Wed, 17 May 2023 13:45:48 +0300 Subject: [PATCH] Changed mouse input reading from dx/dy to screen_dx/dy to become more independent from window size. --- operator/operator/operator.script | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/operator/operator/operator.script b/operator/operator/operator.script index c121a48..cc558dd 100644 --- a/operator/operator/operator.script +++ b/operator/operator/operator.script @@ -28,8 +28,8 @@ go.property('inverted_vertical', false) go.property('minimum', vmath.vector3(-89, -360, 0)) go.property('maximum', vmath.vector3(89, 360, 30)) -go.property('sensitivity', 0.7) -go.property('smoothness', 0.1) +go.property('sensitivity', 0.1) +go.property('smoothness', 0.05) go.property('zoom', 0) go.property('zoom_step', 0.3) @@ -796,13 +796,13 @@ function on_input(self, action_id, action) input.zoom = 1 end - if action.dx and action.dy and not action_id then + if action.screen_dx and action.screen_dy and not action_id then if self.is_pointer_locked ~= pointer.locked then -- Skip the first mouse movement by cursor jumping because locking. self.is_pointer_locked = pointer.locked elseif pointer.locked then - input.horizontal = action.dx or 0 - input.vertical = action.dy or 0 + input.horizontal = action.screen_dx or 0 + input.vertical = action.screen_dy or 0 end end