You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the "3d camera free" on Linux in both web and desktop, GetMouseDelta() is more biased to mouse movements up and to the left. This becomes more noticeable as the frames per second increase.
These can fix the issue without changing raylib's source:
Using the SDL backend
Replacing DisableCursor() with HideCursor(), with the obvious downside of not locking the cursor anymore.
This is sourced within GLFW when using GLFW_CURSOR_DISABLED without GLFW_RAW_MOUSE_MOTION, as can be seen with this code also exhibiting the issue:
When moving your mouse in a circle, the negatives are consistently larger (in absolute value) than the positives, leading to the up-left drift: -10995.000000 7994.000000 => abs difference of 3001 -23081.000000 17624.000000 => abs difference of 5457 -35581.000000 29573.000000 => abs difference of 5908
When adding these lines:
if (glfwRawMouseMotionSupported())
glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
The issue disappears: -27196.000000 27147.000000 => abs difference of 49 -65799.000000 65810.000000 => abs difference of 11 -73800.000000 73830.000000 => abs difference of 30
In this video I'm moving my mouse in a circle, and the cube is very quickly moving down and to the right, which comes from mouse movements being more sensitive up and to the left.
Code Example
"3d camera free", "3d camera first person", "3d picking", and most likely any example that uses DisableCursor() and GetMouseDelta() together on Linux.
The text was updated successfully, but these errors were encountered:
freakmangd
changed the title
[rcore_desktop/rcore_web] Innacurate Mouse Delta When Using DisableCursor On Linux
[rcore_desktop/rcore_web] Inacurate Mouse Delta When Using DisableCursor On Linux
Mar 17, 2024
raysan5
changed the title
[rcore_desktop/rcore_web] Inacurate Mouse Delta When Using DisableCursor On Linux
[rcore_desktop] Inacurate mouse delta with DisableCursor()Apr 21, 2024
@raysan5#3874 fixed the issue on desktop, but web still has this problem (or at least the examples page does) This issue can be closed if you want to use #3916 to track web
Issue description
When running the "3d camera free" on Linux in both web and desktop,
GetMouseDelta()
is more biased to mouse movements up and to the left. This becomes more noticeable as the frames per second increase.These can fix the issue without changing raylib's source:
DisableCursor()
withHideCursor()
, with the obvious downside of not locking the cursor anymore.This is sourced within GLFW when using
GLFW_CURSOR_DISABLED
withoutGLFW_RAW_MOUSE_MOTION
, as can be seen with this code also exhibiting the issue:When moving your mouse in a circle, the negatives are consistently larger (in absolute value) than the positives, leading to the up-left drift:
-10995.000000 7994.000000
=> abs difference of 3001-23081.000000 17624.000000
=> abs difference of 5457-35581.000000 29573.000000
=> abs difference of 5908When adding these lines:
The issue disappears:
-27196.000000 27147.000000
=> abs difference of 49-65799.000000 65810.000000
=> abs difference of 11-73800.000000 73830.000000
=> abs difference of 30#3874 implements this fix for rcore_desktop.
Light testing on Windows showed no effect, another reported case was on Arch Linux.
Environment
Platform backend: DESKTOP (GLFW)
OS: Pop!_OS Ubuntu x64
OpenGL version: 4.6 (Compatibility Profile) Mesa 24.0.0-1pop0
170687273522.04~0fa430cGPU: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] / Mesa Intel® UH
(Laptop integrated Intel graphics card and a discrete RTX 3060)
Issue Screenshot
mouse_bug_showcase.mp4
In this video I'm moving my mouse in a circle, and the cube is very quickly moving down and to the right, which comes from mouse movements being more sensitive up and to the left.
Code Example
"3d camera free", "3d camera first person", "3d picking", and most likely any example that uses
DisableCursor()
andGetMouseDelta()
together on Linux.The text was updated successfully, but these errors were encountered: