From 0f1f3011e065603f3270f471eedfd43327a5a95e Mon Sep 17 00:00:00 2001 From: andrewsumner Date: Fri, 3 Jun 2011 01:59:12 +0000 Subject: [PATCH] rename morley plus driver enhancements git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3654 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: a678785b876e032d4df2efe71a2ca718b393a884 Former-commit-id: 10e91b697522c73aa1fd1fa063817580cdb97d26 --- src/drivers/usr/CMakeLists.txt | 2 +- src/drivers/usr/src/raceline.cpp | 52 +++++++++--- .../usr/usr_ls2/ls2-morley-r900/default.xml | 79 +++++++++++++++++++ 3 files changed, 123 insertions(+), 10 deletions(-) create mode 100755 src/drivers/usr/usr_ls2/ls2-morley-r900/default.xml diff --git a/src/drivers/usr/CMakeLists.txt b/src/drivers/usr/CMakeLists.txt index 4dbb70573..41a06298c 100644 --- a/src/drivers/usr/CMakeLists.txt +++ b/src/drivers/usr/CMakeLists.txt @@ -98,7 +98,7 @@ ROBOT_DATA(NAME usr_ls1 PREFIX usr_ls1 SET(ROBOT_SUBDIRS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ls2-bavaria-g3gtr ls2-boxer-96rsr ls2-cavallo-360r ls2-condor-c400r - ls2-morley-R900 ls2-sprite-gts + ls2-morley-r900 ls2-sprite-gts ls2-vortex-gt ls2-lynx-xkr tracks) diff --git a/src/drivers/usr/src/raceline.cpp b/src/drivers/usr/src/raceline.cpp index c98006fc7..117fc4710 100644 --- a/src/drivers/usr/src/raceline.cpp +++ b/src/drivers/usr/src/raceline.cpp @@ -481,13 +481,36 @@ void LRaceLine::SplitTrack(tTrack *ptrack, int rl) while (psegside != NULL) { if (psegside->style == TR_WALL || psegside->style == TR_FENCE) - margin = MAX(0.0, margin - (psegCurrent->type == TR_STR ? 0.5 : 1.0)); + { + if (psegCurrent->type == TR_STR) + { + margin = MAX(0.0, margin - 0.5); + } + else + { + if ((psegCurrent->type == TR_LFT && side == TR_SIDE_LFT) || + (psegCurrent->type == TR_RGT && side == TR_SIDE_RGT)) + margin = MAX(0.0, margin - 1.5); + else + margin = MAX(0.0, margin - 0.5); + } + } - if (psegside->style != TR_PLAN || - psegside->surface->kFriction < psegCurrent->surface->kFriction*0.8 || - psegside->surface->kRoughness > MAX(0.02, psegCurrent->surface->kRoughness*1.2) || - psegside->surface->kRollRes > MAX(0.005, psegCurrent->surface->kRollRes*1.2)) + if (psegside->style == TR_WALL || psegside->style == TR_FENCE) break; + + if (psegside->style == TR_PLAN && + (psegside->surface->kFriction < psegCurrent->surface->kFriction*0.8 || + (psegside->surface->kRoughness > MAX(0.02, psegCurrent->surface->kRoughness+0.05)) || + (psegside->surface->kRollRes > MAX(0.005, psegCurrent->surface->kRollRes+0.03)))) + break; + + if (psegside->style == TR_CURB && + (psegside->surface->kFriction >= psegCurrent->surface->kFriction * 0.9 && + psegside->surface->kRoughness <= psegCurrent->surface->kRoughness + 0.05 && + psegside->surface->kRollRes <= psegCurrent->surface->kRollRes * 0.03 && + psegside->height <= psegside->width/10)) + break; if (ptrack->pits.type != TR_PIT_NONE) { @@ -510,9 +533,12 @@ void LRaceLine::SplitTrack(tTrack *ptrack, int rl) double thiswidth = MIN(psegside->startWidth, psegside->endWidth) * 1.0; if (psegCurrent->type == TR_STR) - if ((side == TR_SIDE_LFT && (psegCurrent->type == TR_RGT || psegCurrent->next->type != TR_LFT)) || - (side == TR_SIDE_RGT && (psegCurrent->type == TR_LFT || psegCurrent->next->type != TR_RGT))) - thiswidth *= 0.6; + if ((side == TR_SIDE_LFT && psegCurrent->type == TR_LFT && psegside->style == TR_CURB) || + (side == TR_SIDE_RGT && psegCurrent->type == TR_RGT && psegside->style == TR_CURB)) + thiswidth *= 0.5; + else if ((side == TR_SIDE_LFT && (psegCurrent->type == TR_RGT || psegCurrent->next->type != TR_LFT)) || + (side == TR_SIDE_RGT && (psegCurrent->type == TR_LFT || psegCurrent->next->type != TR_RGT))) + thiswidth *= 0.8; margin += thiswidth; psegside = psegside->side[side]; } @@ -940,7 +966,15 @@ void LRaceLine::CalcZCurvature(int rl) if (rl == LINE_MID) camber *= 2; } - double slope = camber + zd/3 * SlopeFactor; + double slope = camber + zd/3 * SlopeFactor; + if (rl != LINE_RL) + { + if (slope < 0.0) + slope *= 1.4; + else + slope *= 0.7; + } + SRL[rl].tFriction[i] *= 1.0 + MAX(-0.4, slope); if (slope < 0.0) diff --git a/src/drivers/usr/usr_ls2/ls2-morley-r900/default.xml b/src/drivers/usr/usr_ls2/ls2-morley-r900/default.xml new file mode 100755 index 000000000..19ba5ffe2 --- /dev/null +++ b/src/drivers/usr/usr_ls2/ls2-morley-r900/default.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + +