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
I'm currently working on mouselook for a first-person game. I am doing this by calling set_capture_cursor(true) on the PistonWindow, and then checking the cursor change via Input::Move(Motion::MouseRelative(x, y)) events.
My problem with this is that it has mouse acceleration—The amount the player rotates is controlled not only by how far the mouse is moved, but by how quickly it is moved as well. Is there some way to make it so that the distance the mouse physically moves is the only thing that affects player rotation?
I'll also point out that the different window backends don't all behave the same. GlutinWindow seemed to have some sort of "buffering", so to speak. If I quickly moved the mouse left then right, the player continued to rotate left before rotating right. As someone who's been playing first-person shooters for the majority of his life...it felt "wrong". Using the Sdl2Window and GlfwWindow backends felt more "right", but they still had the undesired mouse acceleration.
The text was updated successfully, but these errors were encountered:
Update: this may not be as much of an issue as I thought. It turns out that my system did actually have some mouse acceleration already. Disabling it seems to have resolved my main complaint (although my problem with GlutinWindow still stands).
However, I still think there is room for improvement. Currently the cursor's change in movement is being used, which means game movement is tied to how the OS treats the mouse. This means it would be impossible to disable acceleration in-game if the OS has mouse acceleration enabled. I think there should be some way to get input from the mouse directly rather than listen to what the OS says about the cursor's movement.
I'm currently working on mouselook for a first-person game. I am doing this by calling
set_capture_cursor(true)
on thePistonWindow
, and then checking the cursor change viaInput::Move(Motion::MouseRelative(x, y))
events.My problem with this is that it has mouse acceleration—The amount the player rotates is controlled not only by how far the mouse is moved, but by how quickly it is moved as well. Is there some way to make it so that the distance the mouse physically moves is the only thing that affects player rotation?
I'll also point out that the different window backends don't all behave the same.
GlutinWindow
seemed to have some sort of "buffering", so to speak. If I quickly moved the mouse left then right, the player continued to rotate left before rotating right. As someone who's been playing first-person shooters for the majority of his life...it felt "wrong". Using theSdl2Window
andGlfwWindow
backends felt more "right", but they still had the undesired mouse acceleration.The text was updated successfully, but these errors were encountered: