22 static const char *
gearname[
MAX_GEARS] = {
"r",
"n",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8"};
33 tdble gRatio, fRatio, gEff;
35 const int BUFSIZE = 256;
46 for (j = 0; j < 2; j++) {
51 for (j = 0; j < 2; j++) {
96 if (gEff > 1.0f) gEff = 1.0f;
97 if (gEff < 0.0f) gEff = 0.0f;
99 trans->
driveI[i] = (car->
engine.
I + gearI) * (gRatio * gRatio * fRatio * fRatio);
100 trans->
freeI[i] = gearI * (gRatio * gRatio * fRatio * fRatio);
120 switch(trans->
type) {
159 const int BUFSIZE = 256;
166 trans->
driveI[i] = (car->
engine.
I + gearI) * (gRatio * gRatio * fRatio * fRatio);
167 trans->
freeI[i] = gearI * (gRatio * gRatio * fRatio * fRatio);
178 const int BUFSIZE = 256;
194 for (i =
MAX_GEARS - 1; i - 2 >= 0; i--) {
199 setupGear(hdle, car, carElt, trans, gRatio, fRatio, i);
207 setupGear(hdle, car, carElt, trans, gRatio, fRatio, 0);
222 switch(trans->
type) {
253 if (gearbox->
gear != 0) {
276 if (gearbox->
gear != 0) {
306 switch(trans->
type) {
334 differential = differential0;
337 differential = differential1;
int gear
[-1,6] for gear selection
void SimGearboxUpdate(tCar *car)
void SimTransmissionUpdate(tCar *car)
tCarPitSetupValue gearsratio[MAX_GEARS - 2]
tdble gearRatio[MAX_GEARS]
including final drive
void SimDifferentialReConfig(tCar *car, int index)
int gearOffset
gearRatio[gear + gearOffset] is the ratio for gear
bool SimAdjustPitCarSetupParam(tCarPitSetupValue *v)
void SimDifferentialUpdate(tCar *car, tDifferential *differential, int first)
tDifferential differential[3]
tdble overallRatio[MAX_GEARS]
const char * GfParmGetStr(void *parmHandle, const char *path, const char *key, const char *deflt)
Get a string parameter from the parameter set handle.
#define TRANS_CENTRAL_DIFF
float tdble
Floating point type used in TORCS.
#define SECT_FRNTDIFFERENTIAL
static void setupGear(void *hdle, tCar *car, tCarElt *carElt, tTransmission *trans, tdble gRatio, tdble fRatio, int i)
#define SECT_CENTRALDIFFERENTIAL
void SimDifferentialConfig(void *hdle, const char *section, tDifferential *differential)
void SimTransmissionReConfig(tCar *car)
tdble accelCmd
Accelerator command [0.0, 1.0].
tdble GfParmGetNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt)
Get a numerical parameter from the parameter set handle.
static const char * gearname[MAX_GEARS]
int gearNb
incl reverse and neutral
void SimTransmissionConfig(tCar *car)
tTransmission transmission
#define SECT_REARDIFFERENTIAL
void SimUpdateFreeWheels(tCar *car, int axlenb)