New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rcore_web] Relative mouse mode issues #3916
Labels
Comments
raysan5
changed the title
[rcore_web] Relative Mouse Mode
[rcore_web] Relative mouse mode issues
Apr 21, 2024
@cemalgnlts Thanks for reporting!
I'm afraid I'm not understanding the proposed solution, could you send a PR for review? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
Hi,
When
DisableCursor()
is used, the mouse does not enter relative mode and the position is accumulated as the screen is rotated. This is why the mouse ray never gives the correct information.Environment
Web - WASM - Emscripten
Issue Screenshot
When I rotate the screen one turn in the video, the position is doubled and the track from the mouse is not visible, I have to rotate the screen back one turn.
Screen recording 2024-04-11 21.36.17.webm
Code Example
https://www.raylib.com/examples.html
raylib [models] example - Mesh picking in 3d mode, ground plane, triangle, mesh
Suggestions & Ideas
If I look at the pull request here (#3874), this is the method used:
glfwSetInputMode(platform.handle, GLFW_RAW_MOUSE_MOTION, GLFW_FALSE);
But emscripten does not support this: https://github.com/emscripten-core/emscripten/blob/46bd566937e1559a6b732cc78666e5be08cc414d/src/library_glfw.js#L974
However, when the pointer is locked, the browser always gives you the position where it is locked. Therefore, if the pointer is locked (DisableCursor is used), the middle position of the screen can be given instead of the mouse position on the screen.The text was updated successfully, but these errors were encountered: