xbox patch

Matteo Lucchesi <[email protected]> Thu, 24 Jul 2008 14:33:21 +0200
Newsgroups gmane.games.torcs.devel
Organization Luccalug
Message-ID <[email protected]>
I've do a little change to the input joypad section. with a joypad like the 
xbox controllor it's impossible to me make little correction to the 
traiettories. The problem is that the input change too rapid so i introduce a 
variable the chage the max speed how the input can change. I've also add the 
deadZone becouse my joypad isn't centered.

...ehm sorry fo my english. It's the code:

from:

rightSteer = -SIGN(ax0) * cmd[CMD_RIGHTSTEER].pow * pow(fabs(ax0), 
cmd[CMD_RIGHTSTEER].sens) / (1.0 + cmd[CMD_RIGHTSTEER].spdSens * 
car->_speed_x);

to:

rightSteer = ((rap-1) * HCtx[idx]->prevRightSteer + (-SIGN(ax0)) * 
(cmd[CMD_RIGHTSTEER].pow * pow(fabs(ax0), cmd[CMD_RIGHTSTEER].sens) / (1.0 + 
cmd[CMD_RIGHTSTEER].spdSens * car->_speed_x)))/rap + 
cmd[CMD_RIGHTSTEER].deadZone;

if (rightSteer > 0.0) rightSteer = 0.0;
if (rightSteer < -1.0) rightSteer = -1.0;
HCtx[idx]->prevRightSteer = rightSteer;

i think that the variable rap has a good value of 7 but now i'm trying to make 
it configurable in the game.

i don't know if it can be a solution for all joypad but for me is necessary!

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/