|
From: Matteo L. <ma...@lu...> - 2008-07-24 12:33:17
|
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! |