Mouse Acceleration

Posted By: Dooley

Mouse Acceleration - 06/04/19 07:19

I am wondering if there is an existing script that handles how fast the mouse is moving to determine how fast the character/camera turns.

Here is my current script that handles character pan:

Code:
rotate_angle.x = -20*mouse_force.x*time_step*var_mouse_sensitive;	

c_rotate(my,rotate_angle,IGNORE_PASSABLE|IGNORE_FLAG2|GLIDE|USE_POLYGON);



In this case, var_mouse_sensitive is set to 0.5 by default.

Am I missing something important?

Some players feel like the faster you move the mouse, the slower the character pans...
Posted By: Dooley

Re: Mouse Acceleration - 06/04/19 07:22

I looked into using mouse_pos and checking from one frame to the next how far the mouse had moved. This actually works, but once the mouse position reaches the edge of the screen, it no longer registers movement in that direction.
Posted By: txesmi

Re: Mouse Acceleration - 06/04/19 13:17

Quote:
Am I missing something important?

mickey
Posted By: Dooley

Re: Mouse Acceleration - 06/04/19 16:34

Ahhhh!

I knew about mickey. I just thought it was for the mouse wheel. Mind blown. Thank you again, stranger laugh
Posted By: Dooley

Re: Mouse Acceleration - 06/04/19 16:47

In my defense, I search and read everything else related to "mouse" in the manual!
Posted By: txesmi

Re: Mouse Acceleration - 06/04/19 18:58

laugh txesmi aka il brutto

Anyway, I am sure the example on that manual entry is wrong. It multiplies mickey by time_step when mickey is already a frame dependant variable. It is not the mouse speed but the moved pixels in the last frame. A FPS camera should add it raw and smooth the result a bit.
Posted By: Dooley

Re: Mouse Acceleration - 06/04/19 21:25

Good advice! I will play around with it.
© 2024 lite-C Forums