From 046945777281404ae0be65ddb3d00c3af95e3da5 Mon Sep 17 00:00:00 2001 From: torcs-ng Date: Tue, 9 Feb 2021 13:05:13 +0000 Subject: [PATCH] - added simplix_mp1 git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7265 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: d2de2819a10fa96800f1e631d37208e54edc668d Former-commit-id: 7357c61760f59e635c908fa8e974766a80606c73 --- src/drivers/simplix/CMakeLists.txt | 2 +- src/drivers/simplix/src/unitdriver.cpp | 10 +++++----- src/drivers/simplix/src/unitglobal.h | 1 + src/drivers/simplix/src/unitmain.cpp | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/drivers/simplix/CMakeLists.txt b/src/drivers/simplix/CMakeLists.txt index 999685c4f..131960086 100644 --- a/src/drivers/simplix/CMakeLists.txt +++ b/src/drivers/simplix/CMakeLists.txt @@ -74,7 +74,7 @@ SET(ROBOT_SOURCES # Official-only simplix instances. SET(ROBOT_CLONES simplix_36GP simplix_67GP simplix_sc simplix_srw simplix_stock simplix_trb1 simplix_ls1 simplix_ls2 simplix_mp5 - simplix_mpa1 simplix_mpa11 simplix_mpa12 simplix_lp1 simplix_ref) + simplix_mpa1 simplix_mpa11 simplix_mpa12 simplix_lp1 simplix_ref simplix_mp1) # The ubiquitous robot module and its clones. ROBOT_MODULE(NAME ${ROBOT_NAME} VERSION 3.3.0 SOVERSION 1.0.0 diff --git a/src/drivers/simplix/src/unitdriver.cpp b/src/drivers/simplix/src/unitdriver.cpp index 81a41980a..2612260e1 100644 --- a/src/drivers/simplix/src/unitdriver.cpp +++ b/src/drivers/simplix/src/unitdriver.cpp @@ -2957,7 +2957,7 @@ void TDriver::InitAdaptiveShiftLevels() for (I = 0; I < MAX_GEARS; I++) { - oShift[I] = 2000.0; + oShift[I] = 1000.0; if (TDriver::UseGPBrakeLimit) oGearEff[I] = 0.95; else @@ -4975,10 +4975,10 @@ double TDriver::CalcFriction_simplix_REF(const double Crv) //--------------------------------------------------------------------------* void TDriver::CalcSkilling_simplix() { - oSkillScale = oSkillScale / 50.0; - oSkillDriver = oSkillDriver / ((50.0 - oSkillGlobal) / 40.0); - oSkill = oSkillScale * (oSkillGlobal + oSkillDriver * 2) - * (1.0 + oSkillDriver) + oSkillOffset; + oSkillScale = oSkillScale / 50.0; + oSkillDriver = oSkillDriver / ((50.0 - oSkillGlobal) / 40.0); + oSkill = oSkillScale * (oSkillGlobal + oSkillDriver * 2) + * (1.0 + oSkillDriver) + oSkillOffset; /* oSkillScale = oSkillScale/50.0; oSkillDriver = oSkillDriver / (5.0 * ((50.0 - oSkillGlobal)/40.0)); diff --git a/src/drivers/simplix/src/unitglobal.h b/src/drivers/simplix/src/unitglobal.h index 0c1c77868..d2bee665d 100644 --- a/src/drivers/simplix/src/unitglobal.h +++ b/src/drivers/simplix/src/unitglobal.h @@ -113,6 +113,7 @@ extern GfLogger* PLogSimplix; #define RTYPE_SIMPLIX_MPA12 12 // Robot type simplix_mpa12 #define RTYPE_SIMPLIX_STOCK 13 // Robot type simplix_stock #define RTYPE_SIMPLIX_67GP 14 +#define RTYPE_SIMPLIX_MP1 15 // Robot type simplix_mp1 //==========================================================================* //==========================================================================* diff --git a/src/drivers/simplix/src/unitmain.cpp b/src/drivers/simplix/src/unitmain.cpp index 6d3b6f613..fcbc215e7 100644 --- a/src/drivers/simplix/src/unitmain.cpp +++ b/src/drivers/simplix/src/unitmain.cpp @@ -303,6 +303,16 @@ void SetUpSimplix() }; //==========================================================================* +//==========================================================================* +// Schismatic entry point for simplix_mpa1 +//--------------------------------------------------------------------------* +void SetUpSimplix_mp1() +{ + cRobotType = RTYPE_SIMPLIX_MP1; + SetParameters(NBBOTS, "mp1-cavallo-f2005"); + TDriver::SkillingFactor = 0.1f; // Skilling factor for career-mode +}; +//==========================================================================* //==========================================================================* // Schismatic entry point for simplix_mpa1 //--------------------------------------------------------------------------* @@ -611,6 +621,8 @@ int moduleWelcomeV1_00 SetUpSimplix_36GP(); else if (strncmp(RobName,"simplix_67GP",strlen("simplix_67GP")) == 0) SetUpSimplix_67GP(); + else if (strncmp(RobName,"simplix_mp1",strlen("simplix_mp1")) == 0) + SetUpSimplix_mp1(); else if (strncmp(RobName,"simplix_mpa1",strlen("simplix_mpa1")) == 0) SetUpSimplix_mpa1(); else if (strncmp(RobName,"simplix_mpa11",strlen("simplix_mpa11")) == 0) @@ -880,6 +892,17 @@ static int InitFuncPt(int Index, void *Pt) cInstances[Index-IndexOffset].cRobot->SideBorderOuter(0.30f); cInstances[Index-IndexOffset].cRobot->SideBorderInner(0.00f); } + else if (cRobotType == RTYPE_SIMPLIX_MP1) + { + LogSimplix.debug("#cRobotType == RTYPE_SIMPLIX_MP1\n"); + cInstances[Index-IndexOffset].cRobot->CalcSkillingFoo = &TDriver::CalcSkilling_simplix; + cInstances[Index-IndexOffset].cRobot->CalcFrictionFoo = &TDriver::CalcFriction_simplix_Identity; + cInstances[Index-IndexOffset].cRobot->CalcCrvFoo = &TDriver::CalcCrv_simplix_Identity; + cInstances[Index-IndexOffset].cRobot->CalcHairpinFoo = &TDriver::CalcHairpin_simplix_Identity; + cInstances[Index-IndexOffset].cRobot->ScaleSide(0.95f,0.95f); + cInstances[Index-IndexOffset].cRobot->SideBorderOuter(0.30f); + cInstances[Index-IndexOffset].cRobot->SideBorderInner(0.00f); + } else if (cRobotType == RTYPE_SIMPLIX_36GP) { LogSimplix.debug("#cRobotType == RTYPE_SIMPLIX_36GP\n");