- Update USR's driver code

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5902 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 52ffc5f6c61221b1833db72c3d212df8f3979bee
Former-commit-id: d2d0fb05b622cd757ae01901d8c8ba0820fedcb4
This commit is contained in:
torcs-ng 2015-03-17 22:44:51 +00:00
parent ad02663e27
commit 418bda2a88
2 changed files with 22 additions and 13 deletions

View file

@ -2220,12 +2220,21 @@ void LRaceLine::GetRaceLineData(tSituation *s, LRaceLineData *pdata)
double LRaceLine::getAvoidSteer(double offset, LRaceLineData *data)
{
offset *= AvoidOffset;
double steer = 0.0;
//GfLogDebug("USR Offset = %f\n", offset);
double speedoffset = AvoidOffset *((car->_speed_x *3.6)/ 100);
if (speedoffset < 1.0f)
speedoffset = 1.0f;
else if (speedoffset > AvoidOffset)
speedoffset = AvoidOffset ;
vec2f target;
double carspeed = Mag(car->_speed_X, car->_speed_Y);
double steertime = MIN(MaxSteerTime, MinSteerTime + MAX(0.0, carspeed-20.0)/30.0);
offset *= speedoffset;
//offset *=AvoidOffset;
double steer = 0.0;
vec2f target;
double carspeed = Mag(car->_speed_X, car->_speed_Y);
//GfLogDebug("USR Car Speed = %f\n", car->_speed_x * 3.6);
double steertime = MIN(MaxSteerTime, MinSteerTime + MAX(0.0, carspeed-20.0)/30.0);
if (data->followdist < 5.0)
steertime = MIN(MaxSteerTime*1.1, steertime * 1.0 + (5.0 - data->followdist)/20);
//double lane2left = track->width * SRL[SRLidx].tLane[Next];

View file

@ -120,13 +120,13 @@
#define PRV_SKILL_LEVEL "level"
#define PRV_SKILL_AGGRO "aggression"
#define BT_SECT_PRIV "private"
#define BT_ATT_FUELPERLAP "fuelperlap"
#define BT_ATT_FUELPERSECOND "fuelpersecond"
#define BT_ATT_MUFACTOR "mufactor"
#define BT_ATT_PITTIME "pittime"
#define BT_ATT_BESTLAP "bestlap"
#define BT_ATT_WORSTLAP "worstlap"
#define BT_ATT_TEAMMATE "teammate"
#define BT_SECT_PRIV "private"
#define BT_ATT_FUELPERLAP "fuelperlap"
#define BT_ATT_FUELPERSECOND "fuelpersecond"
#define BT_ATT_MUFACTOR "mufactor"
#define BT_ATT_PITTIME "pittime"
#define BT_ATT_BESTLAP "bestlap"
#define BT_ATT_WORSTLAP "worstlap"
#define BT_ATT_TEAMMATE "teammate"
#endif