2 registered members (Ayumi, 1 invisible),
584
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
increase sensitivity
#365571
03/27/11 16:12
03/27/11 16:12
|
Joined: Dec 2009
Posts: 361
rtsgamer706
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2009
Posts: 361
|
I am making a first person game where you look around with the mouse. Using the code below: mouse_pos.x = mouse_cursor.x; mouse_pos.y = mouse_cursor.y; camera.tilt += mouse_force.y; camera.pan -= mouse_force.x; my.pan -= mouse_force.x; the only issue is that its kinda slow, I have to life the mouse three times to make a full rotation. Anyone know how to speed up the turning? Thanks Rstgamer706
|
|
|
Re: increase sensitivity
[Re: rtsgamer706]
#365573
03/27/11 16:19
03/27/11 16:19
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Multiply it with a constant or a variable.
var mouse_sensitivity = 2;
camera.tilt += mouse_force.y * mouse_sensitivity;
camera.pan -= mouse_force.x * mouse_sensitivity;
my.pan -= mouse_force.x * mouse_sensitivity;
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: increase sensitivity
[Re: KingdaKa]
#365633
03/28/11 01:37
03/28/11 01:37
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
User
|
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
You should also multiply these values with "time_step" to make the sensitivity (speed) the same on different systems. This is something that should never be done!! It will make your mouse-speed fps-dependent, meaning that with very low fps you can only turn the camera/player very very slow. If you don't belive me, try it out. No game does this, and it's for a reason.
|
|
|
Re: increase sensitivity
[Re: SchokoKeks]
#365638
03/28/11 04:15
03/28/11 04:15
|
Joined: May 2009
Posts: 1,816 at my pc (duh)
darkinferno
Serious User
|
Serious User
Joined: May 2009
Posts: 1,816
at my pc (duh)
|
You should also multiply these values with "time_step" to make the sensitivity (speed) the same on different systems. This is something that should never be done!! It will make your mouse-speed fps-dependent, meaning that with very low fps you can only turn the camera/player very very slow. If you don't belive me, try it out. No game does this, and it's for a reason. i believe this is true somewhat but in that case, are you saying you dont multiply your speeds by time_step ?
|
|
|
Re: increase sensitivity
[Re: SchokoKeks]
#365646
03/28/11 09:33
03/28/11 09:33
|
Joined: Mar 2010
Posts: 20
KingdaKa
Newbie
|
Newbie
Joined: Mar 2010
Posts: 20
|
This is something that should never be done!!
It will make your mouse-speed fps-dependent, meaning that with very low fps you can only turn the camera/player very very slow. If you don't belive me, try it out.
No game does this, and it's for a reason.
You're right, i thought it would be the same as with the player movement. Normally the time_step var makes things fps-independent, actually in this case its the opposite way around.
|
|
|
Re: increase sensitivity
[Re: darkinferno]
#365653
03/28/11 10:52
03/28/11 10:52
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
i believe this is true somewhat but in that case, are you saying you dont multiply your speeds by time_step ? time_step should only be used when calculating processed data to determine the effect rate it has based on the processing speed, it should not be used with commands that are only requested such as input... if that makes sense
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|