TORCS  1.3.9
The Open Racing Car Simulator
car.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  file : car.h
4  created : Sun Jan 30 12:00:15 CET 2000
5  copyright : (C) 2000-2024 by Eric Espie, Bernhard Wymann
6  email : berniw@bluewin.ch
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
27 #ifndef __CARV1_H__
28 #define __CARV1_H__
29 
30 #include <track.h>
31 #include <plib/sg.h>
32 
33 #define CAR_IDENT 0
34 
35 #define MAX_NAME_LEN 32
36 
37 /* designation */
38 #define FRNT_RGT 0
39 #define FRNT_LFT 1
40 #define REAR_RGT 2
41 #define REAR_LFT 3
42 #define FRNT 0
43 #define REAR 1
44 #define RIGHT 0
45 #define LEFT 1
49 typedef struct
50 {
56  tdble idealTemperature; // Tire ideal temperature
57 } tWheelSpec;
58 /* structure access short cuts */
59 #define _rimRadius(i) info.wheel[i].rimRadius
60 #define _tireHeight(i) info.wheel[i].tireHeight
61 #define _tireWidth(i) info.wheel[i].tireWidth
62 #define _brakeDiskRadius(i) info.wheel[i].brakeDiskRadius
63 #define _wheelRadius(i) info.wheel[i].wheelRadius
66 typedef struct {
67  int exhaustNb;
68  t3Dd exhaustPos[2];
71 
73 typedef struct {
74  char name[MAX_NAME_LEN];
75  char teamname[MAX_NAME_LEN];
76  char carName[MAX_NAME_LEN];
77  char category[MAX_NAME_LEN];
78  int raceNumber;
79  int startRank;
80  int driverType;
81  int skillLevel;
82  tdble iconColor[3];
89  tWheelSpec wheel[4];
91 } tInitCar;
92 /* structure access short cuts */
93 #define _name info.name
94 #define _teamname info.teamname
95 #define _carName info.carName
96 #define _category info.category
97 #define _driverType info.driverType
98 #define _skillLevel info.skillLevel
99 #define _raceNumber info.raceNumber
100 #define _startRank info.startRank
101 #define _dimension info.dimension
102 #define _dimension_x info.dimension.x
103 #define _dimension_y info.dimension.y
104 #define _dimension_z info.dimension.z
105 #define _drvPos_x info.drvPos.x
106 #define _drvPos_y info.drvPos.y
107 #define _drvPos_z info.drvPos.z
108 #define _bonnetPos_x info.bonnetPos.x
109 #define _bonnetPos_y info.bonnetPos.y
110 #define _bonnetPos_z info.bonnetPos.z
111 #define _statGC info.statGC
112 #define _statGC_x info.statGC.x
113 #define _statGC_y info.statGC.y
114 #define _statGC_z info.statGC.z
115 #define _iconColor info.iconColor
116 #define _tank info.tank
117 #define _steerLock info.steerLock
118 #define _exhaustNb info.visualAttr.exhaustNb
119 #define _exhaustPos info.visualAttr.exhaustPos
120 #define _exhaustPower info.visualAttr.exhaustPower
122 #define RM_DRV_HUMAN 1
123 #define RM_DRV_ROBOT 2
124 
125 
126 #define RM_PENALTY_DRIVETHROUGH 1
127 #define RM_PENALTY_STOPANDGO 2
128 
130 typedef struct CarPenalty
131 {
132  int penalty;
134  GF_TAILQ_ENTRY(struct CarPenalty) link;
135 } tCarPenalty;
136 
137 GF_TAILQ_HEAD(CarPenaltyHead, struct CarPenalty);
138 
140 typedef struct {
141  double bestLapTime;
142  bool commitBestLapTime; /* If a rule violation happens (e.g. cutting a corner) the laptime is not commited (false) */
144  double curLapTime;
145  double lastLapTime;
146  double curTime;
148  tdble currentMinSpeedForLap; // Min speed on current lap, reset on start line crossing
149  int laps;
152  int pos;
161  int event;
162  tCarPenaltyHead penaltyList;
164 } tCarRaceInfo;
165 /* structure access */
166 #define _bestLapTime race.bestLapTime
167 #define _commitBestLapTime race.commitBestLapTime
168 #define _deltaBestLapTime race.deltaBestLapTime
169 #define _curLapTime race.curLapTime
170 #define _curTime race.curTime
171 #define _lastLapTime race.lastLapTime
172 #define _topSpeed race.topSpeed
173 #define _currentMinSpeedForLap race.currentMinSpeedForLap
174 #define _laps race.laps
175 #define _nbPitStops race.nbPitStops
176 #define _remainingLaps race.remainingLaps
177 #define _pos race.pos
178 #define _timeBehindLeader race.timeBehindLeader
179 #define _lapsBehindLeader race.lapsBehindLeader
180 #define _timeBehindPrev race.timeBehindPrev
181 #define _timeBeforeNext race.timeBeforeNext
182 #define _distRaced race.distRaced
183 #define _distFromStartLine race.distFromStartLine
184 #define _pit race.pit
185 #define _scheduledEventTime race.scheduledEventTime
186 #define _event race.event
187 #define _penaltyList race.penaltyList
188 #define _penaltyTime race.penaltyTime
189 
191 typedef struct {
194  tdble speed; // total speed, sqrt(vx*vx + vy*vy + vz*vz)
195  sgMat4 posMat;
197  int state;
210 #define RM_CAR_STATE_FINISH 0x00000100
211 #define RM_CAR_STATE_PIT 0x00000001
212 #define RM_CAR_STATE_DNF 0x00000002
213 #define RM_CAR_STATE_PULLUP 0x00000004
214 #define RM_CAR_STATE_PULLSIDE 0x00000008
215 #define RM_CAR_STATE_PULLDN 0x00000010
216 #define RM_CAR_STATE_OUT (RM_CAR_STATE_DNF | RM_CAR_STATE_FINISH)
217 #define RM_CAR_STATE_NO_SIMU 0x000000FF
218 #define RM_CAR_STATE_BROKEN 0x00000200
219 #define RM_CAR_STATE_OUTOFGAS 0x00000400
220 #define RM_CAR_STATE_ELIMINATED 0x00000800
221 #define RM_CAR_STATE_SIMU_NO_MOVE 0x00010000
222  tPosd corner[4];
223 
224 } tPublicCar;
225 /* structure access */
226 #define _DynGC pub.DynGC
227 #define _pos_X pub.DynGC.pos.x
228 #define _pos_Y pub.DynGC.pos.y
229 #define _pos_Z pub.DynGC.pos.z
230 #define _roll pub.DynGC.pos.ax
231 #define _pitch pub.DynGC.pos.ay
232 #define _yaw pub.DynGC.pos.az
233 #define _yaw_rate pub.DynGC.vel.az
234 #define _speed_x pub.DynGC.vel.x
235 #define _speed_y pub.DynGC.vel.y
236 #define _speed_z pub.DynGC.vel.z
237 #define _accel_x pub.DynGC.acc.x
238 #define _accel_y pub.DynGC.acc.y
239 #define _accel_z pub.DynGC.acc.z
240 #define _state pub.state
241 #define _trkPos pub.trkPos
242 #define _speed_X pub.DynGCg.vel.x
243 #define _speed_Y pub.DynGCg.vel.y
244 #define _corner_x(i) pub.corner[i].ax
245 #define _corner_y(i) pub.corner[i].ay
246 #define _posMat pub.posMat
247 
249 typedef struct {
253  int state;
261  tdble currentPressure; // current tire pressure considering temperature
262  tdble currentTemperature; // current temperature
263  tdble currentWear; // [0..1], 1 means totally worn (tread thickness 0)
264  tdble currentGraining; // [0..1], 1 means totally grained
265 } tWheelState;
266 #define _ride(i) priv.wheel[i].relPos.z
267 #define _brakeTemp(i) priv.wheel[i].brakeTemp
268 #define _wheelSpinVel(i) priv.wheel[i].spinVel
269 #define _wheelSeg(i) priv.wheel[i].seg
270 #define _wheelSlipSide(i) priv.wheel[i].slipSide
271 #define _wheelSlipAccel(i) priv.wheel[i].slipAccel
272 #define _wheelFx(i) priv.wheel[i].Fx
273 #define _wheelFy(i) priv.wheel[i].Fy
274 #define _wheelFz(i) priv.wheel[i].Fz
275 
276 #define MAX_GEARS 10 /* including reverse and neutral */
277 
278 typedef struct tCollisionState_ {
280  sgVec3 pos;
281  sgVec3 force;
283 
285 typedef struct {
286  void *paramsHandle;
287  void *carHandle;
289  char modName[MAX_NAME_LEN];
290  tWheelState wheel[4];
291  tPosd corner[4];
292  int gear;
301  tdble gearRatio[MAX_GEARS];
302  int gearNb;
304  tdble skid[4];
305  tdble reaction[4];
306  int collision;
308  float smoke;
311  int dammage;
312  int debug;
314  tdble localPressure; // Environment pressure at cars location
315  int repCmdMaxClicks; // Driver adjustable range for brake repartition during driving
316  int brakeRepartitionCmd; // Current clicks
317  tdble otherSurfaceContribution[4]; // Tire overlap to other surface [0..0.5]
318  tTrackSeg* otherSurfaceSeg[4]; // Other segment where the tire overlaps to
319 
320 } tPrivCar;
321 /* structure access */
322 #define _driverIndex priv.driverIndex
323 #define _paramsHandle priv.paramsHandle
324 #define _carHandle priv.carHandle
325 #define _modName priv.modName
326 #define _enginerpm priv.enginerpm
327 #define _enginerpmRedLine priv.enginerpmRedLine
328 #define _enginerpmMax priv.enginerpmMax
329 #define _enginerpmMaxTq priv.enginerpmMaxTq
330 #define _enginerpmMaxPw priv.enginerpmMaxPw
331 #define _engineMaxTq priv.engineMaxTq
332 #define _engineMaxPw priv.engineMaxPw
333 #define _gearRatio priv.gearRatio
334 #define _gearNb priv.gearNb
335 #define _gearOffset priv.gearOffset
336 #define _fuel priv.fuel
337 #define _gear priv.gear
338 #define _debug priv.debug
339 #define _skid priv.skid
340 #define _reaction priv.reaction
341 #define _dammage priv.dammage
342 
344 typedef struct {
349  int gear;
350  int raceCmd;
351 #define RM_CMD_NONE 0
352 #define RM_CMD_PIT_ASKED 1
353  char msg[4][32];
354 #define RM_MSG_LEN 31
355  float msgColor[4];
356  int lightCmd;
357 #define RM_LIGHT_HEAD1 0x00000001
358 #define RM_LIGHT_HEAD2 0x00000002
359  int brakeRepartitionCmd;
360 } tCarCtrl;
361 #define _steerCmd ctrl.steer
362 #define _accelCmd ctrl.accelCmd
363 #define _brakeCmd ctrl.brakeCmd
364 #define _clutchCmd ctrl.clutchCmd
365 #define _gearCmd ctrl.gear
366 #define _raceCmd ctrl.raceCmd
367 #define _msgCmd ctrl.msg
368 #define _msgColorCmd ctrl.msgColor
369 #define _lightCmd ctrl.lightCmd
370 
371 struct RobotItf;
372 
373 typedef struct
374 {
379 
380 
381 
382 typedef struct
383 {
384  // Steer
386 
387  //Wheel
388  tCarPitSetupValue wheelcamber[4];
389  tCarPitSetupValue wheeltoe[4];
390  tCarPitSetupValue wheelrideheight[4];
391  tCarPitSetupValue wheelcaster[4];
392 
393  // Brake
396 
397  //Suspension
398  tCarPitSetupValue suspspring[4];
399  tCarPitSetupValue susppackers[4];
400  tCarPitSetupValue suspslowbump[4];
401  tCarPitSetupValue suspslowrebound[4];
402  tCarPitSetupValue suspfastbump[4];
403  tCarPitSetupValue suspfastrebound[4];
404  tCarPitSetupValue suspbumpthreshold[4];
405  tCarPitSetupValue suspreboundthreshold[4];
406 
407  // Anti-rollbar
408  tCarPitSetupValue arbspring[2];
409 
410  // Third element
411  tCarPitSetupValue thirdspring[2];
412  tCarPitSetupValue thirdbump[2];
413  tCarPitSetupValue thirdrebound[2];
414  tCarPitSetupValue thirdX0[2];
415 
416  // Gears [1-8]
417  tCarPitSetupValue gearsratio[MAX_GEARS - 2]; // without reverse/neutral
418 
419  // Wings
420  tCarPitSetupValue wingangle[2];
421 
422  // Differential
423  tCarPitSetupValue diffratio[3];
424  tCarPitSetupValue diffmintqbias[3];
425  tCarPitSetupValue diffmaxtqbias[3];
426  tCarPitSetupValue diffslipbias[3];
427  tCarPitSetupValue difflockinginputtq[3];
428  tCarPitSetupValue difflockinginputbraketq[3];
429  enum TDiffType { NONE = 0, SPOOL = 1, FREE = 2, LIMITED_SLIP = 3, VISCOUS_COUPLER = 4};
430  TDiffType diffType[3];
431 } tCarPitSetup;
432 
434 typedef struct
435 {
437  int repair;
438 #define RM_PIT_REPAIR 0
439 #define RM_PIT_STOPANDGO 1
440  int stopType;
442 
443  enum TireChange { NONE = 0, ALL = 1};
444 
446 } tCarPitCmd;
447 #define _pitFuel pitcmd.fuel
448 #define _pitRepair pitcmd.repair
449 #define _pitStopType pitcmd.stopType
450 
451 
455 typedef struct CarElt
456 {
457  int index;
464  struct RobotItf *robot;
465  struct CarElt *next;
466 } tCarElt;
467 
468 
469 
470 /* sections in xml description files */
471 
472 #define SECT_SIMU_SETTINGS "Simulation Options"
473 #define SECT_CAR "Car"
474 #define SECT_FRNT "Front"
475 #define SECT_FRNTWING "Front Wing"
476 #define SECT_FRNTAXLE "Front Axle"
477 #define SECT_FRNTARB "Front Anti-Roll Bar"
478 #define SECT_FRNTRGTWHEEL "Front Right Wheel"
479 #define SECT_FRNTLFTWHEEL "Front Left Wheel"
480 #define SECT_FRNTRGTSUSP "Front Right Suspension"
481 #define SECT_FRNTLFTSUSP "Front Left Suspension"
482 #define SECT_FRNTRGTBRAKE "Front Right Brake"
483 #define SECT_FRNTLFTBRAKE "Front Left Brake"
484 #define SECT_FRNTDIFFERENTIAL "Front Differential"
485 #define SECT_REAR "Rear"
486 #define SECT_REARWING "Rear Wing"
487 #define SECT_REARAXLE "Rear Axle"
488 #define SECT_REARARB "Rear Anti-Roll Bar"
489 #define SECT_REARRGTWHEEL "Rear Right Wheel"
490 #define SECT_REARLFTWHEEL "Rear Left Wheel"
491 #define SECT_REARRGTSUSP "Rear Right Suspension"
492 #define SECT_REARLFTSUSP "Rear Left Suspension"
493 #define SECT_REARRGTBRAKE "Rear Right Brake"
494 #define SECT_REARLFTBRAKE "Rear Left Brake"
495 #define SECT_REARDIFFERENTIAL "Rear Differential"
496 #define SECT_CENTRALDIFFERENTIAL "Central Differential"
497 #define SECT_STEER "Steer"
498 #define SECT_BRKSYST "Brake System"
499 #define SECT_AERODYNAMICS "Aerodynamics"
500 #define SECT_ENGINE "Engine"
501 #define SECT_CLUTCH "Clutch"
502 #define SECT_DRIVETRAIN "Drivetrain"
503 #define SECT_GEARBOX "Gearbox"
504 #define SECT_DRIVER "Driver"
505 #define SECT_BONNET "Bonnet"
506 #define SECT_GROBJECTS "Graphic Objects"
507 #define SECT_EXHAUST "Exhaust"
508 #define SECT_LIGHT "Light"
509 
510 /* parameters names */
511 #define PRM_CATEGORY "category"
512 #define PRM_LEN "body length"
513 #define PRM_WIDTH "body width"
514 #define PRM_OVERALLLEN "overall length"
515 #define PRM_OVERALLWIDTH "overall width"
516 #define PRM_HEIGHT "body height"
517 #define PRM_MASS "mass"
518 #define PRM_FRWEIGHTREP "front-rear weight repartition"
519 #define PRM_FRLWEIGHTREP "front right-left weight repartition"
520 #define PRM_RRLWEIGHTREP "rear right-left weight repartition"
521 #define PRM_GCHEIGHT "GC height"
522 #define PRM_TANK "fuel tank"
523 #define PRM_FUEL "initial fuel"
524 #define PRM_CENTR "mass repartition coefficient"
525 #define PRM_INERTIA "inertia"
526 #define PRM_EFFICIENCY "efficiency"
527 #define PRM_TYPE "type"
528 #define PRM_SIZE "size"
529 
530 /* Tires */
531 #define PRM_MU "mu"
532 #define PRM_RIMDIAM "rim diameter"
533 #define PRM_TIREWIDTH "tire width"
534 #define PRM_TIRERATIO "tire height-width ratio"
535 #define PRM_RIDEHEIGHT "ride height"
536 #define PRM_TOE "toe"
537 #define PRM_CAMBER "camber"
538 #define PRM_CASTER "caster"
539 #define PRM_CA "stiffness"
540 #define PRM_RFACTOR "dynamic friction"
541 #define PRM_EFACTOR "elasticity factor"
542 #define PRM_PRESSURE "pressure"
543 #define PRM_LOADFMAX "load factor max"
544 #define PRM_LOADFMIN "load factor min"
545 #define PRM_OPLOAD "operating load"
546 #define PRM_TREADTHICKNESS "tread thickness"
547 #define PRM_RIMMASS "rim mass"
548 #define PRM_HYSTERESIS "hysteresis"
549 #define PRM_IDEALTEMP "ideal temperature"
550 #define PRM_WEAR "wear"
551 
552 
553 #define PRM_SPR "spring"
554 #define PRM_SUSPCOURSE "suspension course"
555 #define PRM_BELLCRANK "bellcrank"
556 #define PRM_PACKERS "packers"
557 #define PRM_SLOWBUMP "slow bump"
558 #define PRM_SLOWREBOUND "slow rebound"
559 #define PRM_FASTBUMP "fast bump"
560 #define PRM_FASTREBOUND "fast rebound"
561 #define PRM_BUMPTHRESHOLD "fast bump threshold"
562 #define PRM_REBOUNDTHRESHOLD "fast rebound threshold"
563 
564 #define PRM_XPOS "xpos"
565 #define PRM_YPOS "ypos"
566 #define PRM_ZPOS "zpos"
567 
568 #define PRM_STEERLOCK "steer lock"
569 #define PRM_STEERSPD "max steer speed"
570 
571 #define PRM_BRKDIAM "disk diameter"
572 #define PRM_BRKAREA "piston area"
573 #define PRM_BRKREP "front-rear brake repartition"
574 #define PRM_BRKPRESS "max pressure"
575 #define PRM_BRKREPCMD_MAXCLICKS "brake repartition max clicks"
576 #define PRM_BRKREPCMD_CLICKVALUE "brake repartition offset per click"
577 
578 #define PRM_CX "Cx"
579 #define PRM_FCL "front Clift"
580 #define PRM_RCL "rear Clift"
581 #define PRM_FRNTAREA "front area"
582 #define PRM_WINGAREA "area"
583 #define PRM_WINGANGLE "angle"
584 
585 /* Engine */
586 #define PRM_REVSLIM "revs limiter"
587 #define PRM_REVSMAX "revs maxi"
588 #define PRM_TICKOVER "tickover"
589 #define PRM_RPM "rpm"
590 #define PRM_TQ "Tq"
591 #define ARR_DATAPTS "data points"
592 #define PRM_FUELCONS "fuel cons factor"
593 #define PRM_ENGBRKCOEFF "brake coefficient"
594 #define PRM_POWER "power"
595 #define PRM_TURBO "turbo"
596 #define PRM_TURBO_RPM "turbo rpm"
597 #define PRM_TURBO_FACTOR "turbo factor"
598 #define PRM_TURBO_LAG "turbo lag"
599 
600 #define PRM_RATIO "ratio"
601 #define PRM_BIAS "bias"
602 
603 #define ARR_GEARS "gears"
604 #define PRM_SHIFTTIME "shift time"
605 
606 #define PRM_ROLLCENTER "roll center height"
607 
608 #define LST_RANGES "Ranges"
609 #define PRM_THRESHOLD "threshold"
610 #define PRM_CAR "car"
611 #define PRM_WHEELSON "wheels"
612 #define PRM_ENV "env"
613 #define PRM_BONNET "bonnet"
614 #define PRM_WHEEL_TEXTURE "wheel texture"
615 #define PRM_SHADOW_TEXTURE "shadow texture"
616 
617 #define PRM_MIN_TQ_BIAS "min torque bias"
618 #define PRM_MAX_TQ_BIAS "max torque bias"
619 #define PRM_MAX_SLIP_BIAS "max slip bias"
620 #define PRM_LOCKING_TQ "locking input torque"
621 #define PRM_LOCKINGBRAKE_TQ "locking brake input torque"
622 #define PRM_VISCOSITY_FACTOR "viscosity factor"
623 
624 
625 #define VAL_DIFF_NONE "NONE"
626 #define VAL_DIFF_SPOOL "SPOOL"
627 #define VAL_DIFF_FREE "FREE"
628 #define VAL_DIFF_LIMITED_SLIP "LIMITED SLIP"
629 #define VAL_DIFF_VISCOUS_COUPLER "VISCOUS COUPLER"
630 
631 #define VAL_TRANS_RWD "RWD"
632 #define VAL_TRANS_FWD "FWD"
633 #define VAL_TRANS_4WD "4WD"
634 
635 
636 /* graphic */
637 #define PRM_TACHO_TEX "tachometer texture"
638 #define PRM_TACHO_XSZ "tachometer width"
639 #define PRM_TACHO_YSZ "tachometer height"
640 #define PRM_TACHO_XPOS "tachometer x pos"
641 #define PRM_TACHO_YPOS "tachometer y pos"
642 #define PRM_TACHO_NDLXSZ "tachometer needle width"
643 #define PRM_TACHO_NDLYSZ "tachometer needle height"
644 #define PRM_TACHO_XCENTER "tachometer needle x center"
645 #define PRM_TACHO_YCENTER "tachometer needle y center"
646 #define PRM_TACHO_XDIGITCENTER "tachometer digit x center"
647 #define PRM_TACHO_YDIGITCENTER "tachometer digit y center"
648 #define PRM_TACHO_MINVAL "tachometer min value"
649 #define PRM_TACHO_MAXVAL "tachometer max value"
650 #define PRM_TACHO_MINANG "tachometer min angle"
651 #define PRM_TACHO_MAXANG "tachometer max angle"
652 
653 #define PRM_SPEEDO_TEX "speedometer texture"
654 #define PRM_SPEEDO_XSZ "speedometer width"
655 #define PRM_SPEEDO_YSZ "speedometer height"
656 #define PRM_SPEEDO_XPOS "speedometer x pos"
657 #define PRM_SPEEDO_YPOS "speedometer y pos"
658 #define PRM_SPEEDO_NDLXSZ "speedometer needle width"
659 #define PRM_SPEEDO_NDLYSZ "speedometer needle height"
660 #define PRM_SPEEDO_XCENTER "speedometer needle x center"
661 #define PRM_SPEEDO_YCENTER "speedometer needle y center"
662 #define PRM_SPEEDO_XDIGITCENTER "speedometer digit x center"
663 #define PRM_SPEEDO_YDIGITCENTER "speedometer digit y center"
664 #define PRM_SPEEDO_MINVAL "speedometer min value"
665 #define PRM_SPEEDO_MAXVAL "speedometer max value"
666 #define PRM_SPEEDO_MINANG "speedometer min angle"
667 #define PRM_SPEEDO_MAXANG "speedometer max angle"
668 #define PRM_SPEEDO_DIGITAL "speedometer digital"
669 
670 #define PRM_WHEEL_3D "3d wheel basename"
671 #define PRM_WHEEL_3D_DIR "3d wheel directory"
672 
673 /* Lights */
674 #define VAL_LIGHT_HEAD1 "head1"
675 #define VAL_LIGHT_HEAD2 "head2"
676 #define VAL_LIGHT_BRAKE "brake"
677 #define VAL_LIGHT_BRAKE2 "brake2"
678 #define VAL_LIGHT_REVERSE "reverse"
679 #define VAL_LIGHT_REAR "rear"
680 /* Simulation Options */
681 #define PRM_DAMAGE_TYRES "damage/tyres"
682 #define PRM_DAMAGE_SUSPENSION "damage/suspension"
683 #define PRM_DAMAGE_ALIGNMENT "damage/alignment"
684 #define PRM_DAMAGE_AERO "damage/aero"
685 #define PRM_MODEL_AEROFLOW "model/aero/flow"
686 #define PRM_MODEL_AERO_FACTOR "model/aero/factor"
687 #define PRM_MODEL_TYRE_TEMPERATURE "model/tyre/temperature"
688 
689 // Collision constants.
690 #define SEM_COLLISION 0x01
691 #define SEM_COLLISION_XYSCENE 0x02
692 #define SEM_COLLISION_CAR 0x04
693 #define SEM_COLLISION_Z 0x08
694 #define SEM_COLLISION_Z_CRASH 0x10
695 
696 
697 #endif /* __CARV1_H__ */
698 
699 
700 
tdble engineMaxTq
Definition: car.h:299
sgVec3 force
Definition: car.h:281
tdble Fy
Definition: car.h:259
int gear
[-1,6] for gear selection
Definition: car.h:349
int remainingLaps
Definition: car.h:151
tdble slipAccel
Definition: car.h:257
double bestLapTime
Definition: car.h:141
tdble Fx
Definition: car.h:258
tCarRaceInfo race
public
Definition: car.h:460
struct tCollisionState_ tCollisionState
tdble max
Definition: car.h:377
int raceCmd
command issued by the driver
Definition: car.h:350
tCollisionState collision_state
collision state
Definition: car.h:313
tdble enginerpmMax
Definition: car.h:296
Interface Structure for Robots.
Definition: robot.h:107
tdble brakeCmd
Brake command [0.0, 1.0].
Definition: car.h:347
int raceNumber
Car&#39;s race number.
Definition: car.h:78
int laps
Definition: car.h:149
tInitCar info
public
Definition: car.h:458
sgMat4 posMat
position matrix
Definition: car.h:195
int lightCmd
Lights command.
Definition: car.h:356
TireChange tireChange
Definition: car.h:445
tCarCtrl ctrl
private
Definition: car.h:462
struct CarElt tCarElt
Car structure (tCarElt).
int brakeRepartitionCmd
Definition: car.h:316
Location on the track in local coordinates.
Definition: track.h:418
t3Dd dimension
Car&#39;s mesures.
Definition: car.h:83
double timeBehindLeader
Definition: car.h:153
tdble enginerpmMaxPw
Definition: car.h:298
tdble wheelRadius
Overall wheel radius.
Definition: car.h:55
Car structure (tCarElt).
Definition: car.h:455
int gearOffset
gearRatio[gear + gearOffset] is the ratio for gear
Definition: car.h:303
One penalty.
Definition: car.h:130
int collision_count
Definition: car.h:279
int event
Definition: car.h:161
double lastLapTime
Definition: car.h:145
tCarPitCmd pitcmd
private
Definition: car.h:463
tdble clutchCmd
Clutch command [0.0, 1.0].
Definition: car.h:348
int debug
Definition: car.h:312
double deltaBestLapTime
Definition: car.h:143
int startRank
Car&#39;s starting position.
Definition: car.h:79
tCarPitSetupValue brakePressure
Definition: car.h:394
float smoke
Definition: car.h:308
TireChange
Definition: car.h:443
GF_TAILQ_ENTRY(struct CarPenalty) link
tdble currentTemperature
Definition: car.h:262
double scheduledEventTime
Definition: car.h:159
tVisualAttributes visualAttr
Visual attributes.
Definition: car.h:90
tdble penaltyTime
Definition: car.h:163
double timeBeforeNext
Definition: car.h:156
Public info on the cars.
Definition: car.h:191
int simcollision
For rules etc.
Definition: car.h:307
tdble currentGraining
Definition: car.h:264
t3Dd statGC
Static pos of GC (should be the origin of car axis)
Definition: car.h:88
tCarPitSetupValue brakeRepartition
Definition: car.h:395
tdble exhaustPower
Power of the flames (from 1 to 3)
Definition: car.h:69
tCarPitSetupValue steerLock
Definition: car.h:385
struct CarPenalty tCarPenalty
One penalty.
tdble steerLock
Steer lock angle.
Definition: car.h:87
tTrackOwnPit * pit
Definition: car.h:160
tdble rollRes
rolling resistance, useful for sound
Definition: car.h:255
tPosd relPos
position relative to GC
Definition: car.h:250
tdble localPressure
Definition: car.h:314
bool commitBestLapTime
Definition: car.h:142
tdble engineMaxPw
Definition: car.h:300
tdble idealTemperature
Definition: car.h:56
tdble slipSide
Definition: car.h:256
tdble steer
Steer command [-1.0, 1.0].
Definition: car.h:345
tdble currentPressure
Definition: car.h:261
tDynPt DynGC
GC data (car axis)
Definition: car.h:192
Driver&#39;s pit.
Definition: track.h:440
float tdble
Floating point type used in TORCS.
Definition: tgf.h:48
struct RobotItf * robot
private
Definition: car.h:464
Race Administrative info.
Definition: car.h:140
int driverIndex
index when multiple drivers are in the same dll
Definition: car.h:288
void * carHandle
parameters for car caracteristics
Definition: car.h:287
Static Public info.
Definition: car.h:73
tdble value
Definition: car.h:375
sgVec3 pos
Definition: car.h:280
tdble brakeDiskRadius
Brake disk radius.
Definition: car.h:54
tdble currentMinSpeedForLap
Definition: car.h:148
tCarPitSetup setup
Definition: car.h:441
tPublicCar pub
public
Definition: car.h:459
tdble rimRadius
Rim radius.
Definition: car.h:51
Dynamic wheel information.
Definition: car.h:249
double timeBehindPrev
Definition: car.h:155
tdble Fz
Definition: car.h:260
tdble enginerpmRedLine
Definition: car.h:295
GF_TAILQ_HEAD(CarPenaltyHead, struct CarPenalty)
tPrivCar priv
private
Definition: car.h:461
int pos
Definition: car.h:152
6 DOF position.
Definition: tgf.h:130
int state
wheel state
Definition: car.h:253
int index
car index
Definition: car.h:457
int driverType
Driver type.
Definition: car.h:80
Wheels Specifications.
Definition: car.h:49
void * paramsHandle
accessible parameters for modules
Definition: car.h:286
tCarPenaltyHead penaltyList
List of current penalties.
Definition: car.h:162
tdble accelCmd
Accelerator command [0.0, 1.0].
Definition: car.h:346
int collision
Collision value for graphics and sound, clearing is managed by consumers.
Definition: car.h:306
Track segment (tTrackSeg) The segments can be straights (type TR_STR): (the track goes from the right...
Definition: track.h:276
t3Dd collpos
Collision position, useful for sound.
Definition: car.h:310
int gearNb
incl reverse and neutral
Definition: car.h:302
tTrackSeg * seg
Track segment where the wheel is.
Definition: car.h:254
tdble currentWear
Definition: car.h:263
tdble enginerpmMaxTq
Definition: car.h:297
int stopType
Definition: car.h:440
tdble speed
Definition: car.h:194
int lapToClear
the lap before the penalty has to be cleared
Definition: car.h:133
int dammage
Definition: car.h:311
int penalty
penalty type
Definition: car.h:132
tdble fuel
Definition: car.h:436
t3Dd drvPos
Driver&#39;s position.
Definition: car.h:84
tdble fuel
remaining fuel (liters)
Definition: car.h:293
t3Dd bonnetPos
Bonnet&#39;s position.
Definition: car.h:85
tdble tireWidth
Tire width.
Definition: car.h:53
Data known only by the driver.
Definition: car.h:285
double curTime
Definition: car.h:146
3D point.
Definition: tgf.h:115
tdble min
Definition: car.h:376
tdble tireHeight
Tire height.
Definition: car.h:52
tdble enginerpm
Definition: car.h:294
t3Dd normal
Definition: car.h:309
Dynamic point structure.
Definition: tgf.h:142
tdble distRaced
Definition: car.h:157
int repCmdMaxClicks
Definition: car.h:315
Track Structure and Track Loader Module Definition.
int skillLevel
Driver&#39;s skill level (0=rookie -> 3=pro)
Definition: car.h:81
tdble brakeTemp
brake temperature from 0 (cool) to 1.0 (hot)
Definition: car.h:252
Info returned by driver during the race.
Definition: car.h:344
int exhaustNb
Number of exhaust pipes (max 2)
Definition: car.h:67
tTrkLocPos trkPos
current track position.
Definition: car.h:196
tdble tank
Fuel tank capa.
Definition: car.h:86
tdble distFromStartLine
Definition: car.h:158
tdble spinVel
spin velocity rad/s
Definition: car.h:251
int lapsBehindLeader
Definition: car.h:154
int repair
Definition: car.h:437
int nbPitStops
Definition: car.h:150
#define MAX_GEARS
Definition: car.h:276
struct CarElt * next
Definition: car.h:465
tdble topSpeed
Definition: car.h:147
Static visual attributes.
Definition: car.h:66
double curLapTime
Definition: car.h:144
int state
state of the car.
Definition: car.h:197
#define MAX_NAME_LEN
Definition: car.h:35
int gear
current gear
Definition: car.h:292
tDynPt DynGCg
GC data (world axis)
Definition: car.h:193
Command issued by the car during pit stop.
Definition: car.h:434