From 7a6243875dc7e0a0e11c14255106f3afd7cba206 Mon Sep 17 00:00:00 2001 From: torcs-ng Date: Thu, 28 May 2020 11:42:11 +0000 Subject: [PATCH] - add code for simplix_67GP git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7109 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 91cb36c52268f2006a3c33b646b61ca07471cb70 Former-commit-id: ab3c1dd16ee1576787e46b370b3677678050a1c1 --- src/drivers/simplix/CMakeLists.txt | 4 ++-- src/drivers/simplix/src/unitglobal.h | 1 + src/drivers/simplix/src/unitmain.cpp | 26 +++++++++++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/drivers/simplix/CMakeLists.txt b/src/drivers/simplix/CMakeLists.txt index 1efa2a4dd..999685c4f 100644 --- a/src/drivers/simplix/CMakeLists.txt +++ b/src/drivers/simplix/CMakeLists.txt @@ -13,7 +13,7 @@ SET(ROBOT_INTERFACE LEGACY WELCOME) # #ENDIF() -SET(ROBOT_SOURCES +SET(ROBOT_SOURCES src/unitcarparam.cpp src/unitcarparam.h src/unitcharacteristic.cpp @@ -73,7 +73,7 @@ SET(ROBOT_SOURCES ) # Official-only simplix instances. -SET(ROBOT_CLONES simplix_36GP simplix_sc simplix_srw simplix_stock simplix_trb1 simplix_ls1 simplix_ls2 simplix_mp5 +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) # The ubiquitous robot module and its clones. diff --git a/src/drivers/simplix/src/unitglobal.h b/src/drivers/simplix/src/unitglobal.h index 5c50e9a63..0c1c77868 100644 --- a/src/drivers/simplix/src/unitglobal.h +++ b/src/drivers/simplix/src/unitglobal.h @@ -112,6 +112,7 @@ extern GfLogger* PLogSimplix; #define RTYPE_SIMPLIX_MPA11 11 // Robot type simplix_mpa11 #define RTYPE_SIMPLIX_MPA12 12 // Robot type simplix_mpa12 #define RTYPE_SIMPLIX_STOCK 13 // Robot type simplix_stock +#define RTYPE_SIMPLIX_67GP 14 //==========================================================================* //==========================================================================* diff --git a/src/drivers/simplix/src/unitmain.cpp b/src/drivers/simplix/src/unitmain.cpp index eae941e1e..6d3b6f613 100644 --- a/src/drivers/simplix/src/unitmain.cpp +++ b/src/drivers/simplix/src/unitmain.cpp @@ -398,11 +398,23 @@ void SetUpSimplix_36GP() SetParameters(NBBOTS, "36GP-alfa12c"); TDriver::AdvancedParameters = true; //TDriver::UseBrakeLimit = true; - TDriver::UseSCSkilling = true; + TDriver::UseSCSkilling = true; TDriver::SkillingFactor = 0.1f; // Skilling factor for career-mode }; //==========================================================================* +//==========================================================================* +// Schismatic entry point for simplix_36GP +//--------------------------------------------------------------------------* +void SetUpSimplix_67GP() +{ + cRobotType = RTYPE_SIMPLIX_67GP; + SetParameters(NBBOTS, "67GP-cavallo-123"); + TDriver::AdvancedParameters = true; + //TDriver::UseBrakeLimit = true; + TDriver::UseSCSkilling = true; + TDriver::SkillingFactor = 0.1f; // Skilling factor for career-mode +}; //==========================================================================* // Schismatic entry point for simplix_ls1 //--------------------------------------------------------------------------* @@ -597,6 +609,8 @@ int moduleWelcomeV1_00 SetUpSimplix_srw(); else if (strncmp(RobName,"simplix_36GP",strlen("simplix_36GP")) == 0) SetUpSimplix_36GP(); + else if (strncmp(RobName,"simplix_67GP",strlen("simplix_67GP")) == 0) + SetUpSimplix_67GP(); else if (strncmp(RobName,"simplix_mpa1",strlen("simplix_mpa1")) == 0) SetUpSimplix_mpa1(); else if (strncmp(RobName,"simplix_mpa11",strlen("simplix_mpa11")) == 0) @@ -880,6 +894,16 @@ static int InitFuncPt(int Index, void *Pt) //cInstances[Index-IndexOffset].cRobot->SideBorderOuter(0.75f); //cInstances[Index-IndexOffset].cRobot->UseFilterAccel(); } + else if (cRobotType == RTYPE_SIMPLIX_67GP) + { + LogSimplix.debug("#cRobotType == RTYPE_SIMPLIX_67GP\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.5f); + } else if (cRobotType == RTYPE_SIMPLIX_MPA1) { LogSimplix.debug("#cRobotType == RTYPE_SIMPLIX_MPA1\n");