Skip to content
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

Input::mouseDelta jumps when mouse moves for the first time #1439

Open
RiscadoA opened this issue Jan 27, 2025 · 0 comments
Open

Input::mouseDelta jumps when mouse moves for the first time #1439

RiscadoA opened this issue Jan 27, 2025 · 0 comments
Assignees
Labels
A-Engine B-Input C-Bug D-Good-First-Issue Easy but interesting P-Urgent This issue is a big priority, and it would be good to close it ASAP
Milestone

Comments

@RiscadoA
Copy link
Member

Problem

The mouseDelta input method returns the movement of the mouse in the last frame. The first time the mouse moves though, it gives a huge delta, which makes FPS cameras and stuff like that buggy - the game dev must add a bool checking whether it is the first movement or not, and ignore it if it is.

Solution

We should keep a flag on whether the mouse has moved before. If it hasn't, then the first mouse delta is discarded automatically and the method should return (0, 0).

@RiscadoA RiscadoA added A-Engine B-Input C-Bug D-Trivial Can be done in 30 minutes P-Urgent This issue is a big priority, and it would be good to close it ASAP labels Jan 27, 2025
@RiscadoA RiscadoA added D-Good-First-Issue Easy but interesting and removed D-Trivial Can be done in 30 minutes labels Feb 26, 2025
@mcanais mcanais self-assigned this Feb 28, 2025
@RiscadoA RiscadoA added this to the 0.7 milestone Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Engine B-Input C-Bug D-Good-First-Issue Easy but interesting P-Urgent This issue is a big priority, and it would be good to close it ASAP
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants