TORCS  1.3.9
The Open Racing Car Simulator
sim.h File Reference
#include <math.h>
#include <stdio.h>
#include <cstring>
#include <tgf.h>
#include <track.h>
#include <car.h>
#include <raceman.h>
#include <simu.h>
#include "carstruct.h"
#include <robottools.h>
Include dependency graph for sim.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SIM_VECT_COLL   12
 
#define SIM_VECT_SPD   13
 
#define SIM_VECT_ACCEL   14
 
#define SIM_WHEEL_SPD   16
 
#define SIM_WHEEL_ACCEL   20
 
#define SIM_Z_OFFSET   2.0
 

Functions

void SimConfig (tCarElt *carElt, RmInfo *)
 
void SimReConfig (tCarElt *carElt)
 
void SimUpdate (tSituation *, double deltaTime, int telemetry)
 
void SimInit (int nbcars, tTrack *track, tdble fuelFactor, tdble damageFactor, tdble tireFactor)
 
void SimShutdown (void)
 
void SimAtmosphereConfig (tCar *car)
 
void SimAtmosphereUpdate (tCar *car, tSituation *s)
 
void SimAxleConfig (tCar *car, int index)
 
void SimAxleReConfig (tCar *car, int index)
 
void SimAxleUpdate (tCar *car, int index)
 
void SimCarConfig (tCar *car)
 
void SimCarUpdate (tCar *car, tSituation *)
 
void SimCarUpdate2 (tCar *car, tSituation *)
 
void SimSuspCheckIn (tSuspension *susp)
 
void SimSuspUpdate (tSuspension *susp)
 
void SimSuspConfig (void *hdle, const char *section, tSuspension *susp, tdble F0, tdble X0)
 
void SimSuspReConfig (tCar *car, int index, tSuspension *susp, tdble F0, tdble X0)
 
void SimSuspThirdReConfig (tCar *car, int index, tSuspension *susp, tdble F0, tdble X0)
 
void SimWheelConfig (tCar *car, int index)
 
void SimWheelReConfig (tCar *car, int index)
 
void SimWheelUpdateRide (tCar *car, int index)
 
void SimWheelUpdateForce (tCar *car, int index)
 
void SimWheelUpdateRotation (tCar *car)
 
void SimUpdateFreeWheels (tCar *car, int axlenb)
 
void SimWheelUpdateTire (tCar *car, int index)
 
void SimWheelResetWear (tCar *car, int index)
 
void SimSteerConfig (tCar *car)
 
void SimSteerReConfig (tCar *car)
 
void SimSteerUpdate (tCar *car)
 
void SimBrakeConfig (void *hdle, const char *section, tBrake *brake)
 
void SimBrakeUpdate (tCar *car, tWheel *wheel, tBrake *brake)
 
void SimBrakeSystemConfig (tCar *car)
 
void SimBrakeSystemReConfig (tCar *car)
 
void SimBrakeSystemUpdate (tCar *car)
 
void SimAeroConfig (tCar *car)
 
void SimAeroUpdate (tCar *car, tSituation *s)
 
void SimWingConfig (tCar *car, int index)
 
void SimWingReConfig (tCar *car, int index)
 
void SimWingUpdate (tCar *car, int index, tSituation *s)
 
void SimCarUpdateWheelPos (tCar *car)
 
void SimTransmissionConfig (tCar *car)
 
void SimTransmissionReConfig (tCar *car)
 
void SimTransmissionUpdate (tCar *car)
 
void SimGearboxUpdate (tCar *car)
 
void SimDifferentialConfig (void *hdle, const char *section, tDifferential *differential)
 
void SimDifferentialReConfig (tCar *car, int index)
 
void SimDifferentialUpdate (tCar *car, tDifferential *differential, int first)
 
void SimEngineConfig (tCar *car)
 
void SimEngineUpdateTq (tCar *car)
 
tdble SimEngineUpdateRpm (tCar *car, tdble axleRpm)
 
void SimEngineShutdown (tCar *car)
 
void SimCarCollideZ (tCar *car)
 
void SimCarCollideXYScene (tCar *car)
 
void SimCarCollideCars (tSituation *)
 
void SimCarCollideConfig (tCar *car, tTrack *track)
 
void SimCarCollideShutdown (int nbcars)
 
void SimCarCollideInit (tTrack *track)
 
void SimCollideRemoveCar (tCar *car, int nbcars)
 
bool SimAdjustPitCarSetupParam (tCarPitSetupValue *v)
 
float urandom ()
 return a number drawn uniformly from [0,1] More...
 

Variables

tdble SimDeltaTime
 
int SimTelemetry
 
tCarSimCarTable
 
tdble rulesFuelFactor
 
tdble rulesDamageFactor
 
tdble rulesTireFactor
 
tdble simDammageFactor []
 
tdble simSkidFactor []
 

Macro Definition Documentation

◆ SIM_VECT_ACCEL

#define SIM_VECT_ACCEL   14

Definition at line 131 of file sim.h.

◆ SIM_VECT_COLL

#define SIM_VECT_COLL   12

Definition at line 129 of file sim.h.

◆ SIM_VECT_SPD

#define SIM_VECT_SPD   13

Definition at line 130 of file sim.h.

◆ SIM_WHEEL_ACCEL

#define SIM_WHEEL_ACCEL   20

Definition at line 133 of file sim.h.

◆ SIM_WHEEL_SPD

#define SIM_WHEEL_SPD   16

Definition at line 132 of file sim.h.

◆ SIM_Z_OFFSET

#define SIM_Z_OFFSET   2.0

Definition at line 135 of file sim.h.

Function Documentation

◆ SimAdjustPitCarSetupParam()

bool SimAdjustPitCarSetupParam ( tCarPitSetupValue v)

Definition at line 491 of file simu.cpp.

◆ SimAeroConfig()

void SimAeroConfig ( tCar car)

Definition at line 23 of file aero.cpp.

Here is the call graph for this function:

◆ SimAeroUpdate()

void SimAeroUpdate ( tCar car,
tSituation s 
)

Definition at line 37 of file aero.cpp.

◆ SimAtmosphereConfig()

void SimAtmosphereConfig ( tCar car)

Definition at line 22 of file atmosphere.cpp.

◆ SimAtmosphereUpdate()

void SimAtmosphereUpdate ( tCar car,
tSituation s 
)

Definition at line 28 of file atmosphere.cpp.

◆ SimAxleConfig()

void SimAxleConfig ( tCar car,
int  index 
)

Definition at line 23 of file axle.cpp.

Here is the call graph for this function:

◆ SimAxleReConfig()

void SimAxleReConfig ( tCar car,
int  index 
)

Definition at line 49 of file axle.cpp.

Here is the call graph for this function:

◆ SimAxleUpdate()

void SimAxleUpdate ( tCar car,
int  index 
)

Definition at line 66 of file axle.cpp.

Here is the call graph for this function:

◆ SimBrakeConfig()

void SimBrakeConfig ( void *  hdle,
const char *  section,
tBrake brake 
)

Definition at line 21 of file brake.cpp.

Here is the call graph for this function:

◆ SimBrakeSystemConfig()

void SimBrakeSystemConfig ( tCar car)

Definition at line 48 of file brake.cpp.

Here is the call graph for this function:

◆ SimBrakeSystemReConfig()

void SimBrakeSystemReConfig ( tCar car)

Definition at line 59 of file brake.cpp.

Here is the call graph for this function:

◆ SimBrakeSystemUpdate()

void SimBrakeSystemUpdate ( tCar car)

Definition at line 73 of file brake.cpp.

◆ SimBrakeUpdate()

void SimBrakeUpdate ( tCar car,
tWheel wheel,
tBrake brake 
)

Definition at line 35 of file brake.cpp.

◆ SimCarCollideCars()

void SimCarCollideCars ( tSituation )

Definition at line 748 of file collide.cpp.

Here is the call graph for this function:

◆ SimCarCollideConfig()

void SimCarCollideConfig ( tCar car,
tTrack track 
)

Definition at line 700 of file collide.cpp.

Here is the call graph for this function:

◆ SimCarCollideInit()

void SimCarCollideInit ( tTrack track)

Definition at line 720 of file collide.cpp.

Here is the call graph for this function:

◆ SimCarCollideShutdown()

void SimCarCollideShutdown ( int  nbcars)

Definition at line 522 of file collide.cpp.

Here is the call graph for this function:

◆ SimCarCollideXYScene()

void SimCarCollideXYScene ( tCar car)

Definition at line 101 of file collide.cpp.

Here is the call graph for this function:

◆ SimCarCollideZ()

void SimCarCollideZ ( tCar car)

Definition at line 25 of file collide.cpp.

Here is the call graph for this function:

◆ SimCarConfig()

void SimCarConfig ( tCar car)

Definition at line 29 of file car.cpp.

Here is the call graph for this function:

◆ SimCarUpdate()

void SimCarUpdate ( tCar car,
tSituation  
)

Definition at line 409 of file car.cpp.

Here is the call graph for this function:

◆ SimCarUpdate2()

void SimCarUpdate2 ( tCar car,
tSituation  
)

Definition at line 427 of file car.cpp.

Here is the call graph for this function:

◆ SimCarUpdateWheelPos()

void SimCarUpdateWheelPos ( tCar car)

Definition at line 275 of file car.cpp.

◆ SimCollideRemoveCar()

void SimCollideRemoveCar ( tCar car,
int  nbcars 
)

Definition at line 496 of file collide.cpp.

Here is the call graph for this function:

◆ SimConfig()

void SimConfig ( tCarElt carElt,
RmInfo  
)

Definition at line 119 of file simu.cpp.

Here is the call graph for this function:

◆ SimDifferentialConfig()

void SimDifferentialConfig ( void *  hdle,
const char *  section,
tDifferential differential 
)

Definition at line 56 of file differential.cpp.

Here is the call graph for this function:

◆ SimDifferentialReConfig()

void SimDifferentialReConfig ( tCar car,
int  index 
)

Definition at line 87 of file differential.cpp.

Here is the call graph for this function:

◆ SimDifferentialUpdate()

void SimDifferentialUpdate ( tCar car,
tDifferential differential,
int  first 
)

Definition at line 167 of file differential.cpp.

Here is the call graph for this function:

◆ SimEngineConfig()

void SimEngineConfig ( tCar car)

Definition at line 23 of file engine.cpp.

Here is the call graph for this function:

◆ SimEngineShutdown()

void SimEngineShutdown ( tCar car)

Definition at line 212 of file engine.cpp.

◆ SimEngineUpdateRpm()

tdble SimEngineUpdateRpm ( tCar car,
tdble  axleRpm 
)

Definition at line 162 of file engine.cpp.

Here is the call graph for this function:

◆ SimEngineUpdateTq()

void SimEngineUpdateTq ( tCar car)

Definition at line 112 of file engine.cpp.

◆ SimGearboxUpdate()

void SimGearboxUpdate ( tCar car)

Definition at line 214 of file transmission.cpp.

◆ SimInit()

void SimInit ( int  nbcars,
tTrack track,
tdble  fuelFactor,
tdble  damageFactor,
tdble  tireFactor 
)

Definition at line 463 of file simu.cpp.

Here is the call graph for this function:

◆ SimReConfig()

void SimReConfig ( tCarElt carElt)

Definition at line 139 of file simu.cpp.

Here is the call graph for this function:

◆ SimShutdown()

void SimShutdown ( void  )

Definition at line 474 of file simu.cpp.

Here is the call graph for this function:

◆ SimSteerConfig()

void SimSteerConfig ( tCar car)

Definition at line 21 of file steer.cpp.

Here is the call graph for this function:

◆ SimSteerReConfig()

void SimSteerReConfig ( tCar car)

Definition at line 31 of file steer.cpp.

Here is the call graph for this function:

◆ SimSteerUpdate()

void SimSteerUpdate ( tCar car)

Definition at line 41 of file steer.cpp.

◆ SimSuspCheckIn()

void SimSuspCheckIn ( tSuspension susp)

Definition at line 101 of file susp.cpp.

◆ SimSuspConfig()

void SimSuspConfig ( void *  hdle,
const char *  section,
tSuspension susp,
tdble  F0,
tdble  X0 
)

Definition at line 140 of file susp.cpp.

Here is the call graph for this function:

◆ SimSuspReConfig()

void SimSuspReConfig ( tCar car,
int  index,
tSuspension susp,
tdble  F0,
tdble  X0 
)

Definition at line 161 of file susp.cpp.

Here is the call graph for this function:

◆ SimSuspThirdReConfig()

void SimSuspThirdReConfig ( tCar car,
int  index,
tSuspension susp,
tdble  F0,
tdble  X0 
)

Definition at line 218 of file susp.cpp.

Here is the call graph for this function:

◆ SimSuspUpdate()

void SimSuspUpdate ( tSuspension susp)

Definition at line 122 of file susp.cpp.

Here is the call graph for this function:

◆ SimTransmissionConfig()

void SimTransmissionConfig ( tCar car)

Definition at line 24 of file transmission.cpp.

Here is the call graph for this function:

◆ SimTransmissionReConfig()

void SimTransmissionReConfig ( tCar car)

Definition at line 171 of file transmission.cpp.

Here is the call graph for this function:

◆ SimTransmissionUpdate()

void SimTransmissionUpdate ( tCar car)

Definition at line 299 of file transmission.cpp.

Here is the call graph for this function:

◆ SimUpdate()

void SimUpdate ( tSituation ,
double  deltaTime,
int  telemetry 
)

Definition at line 323 of file simu.cpp.

Here is the call graph for this function:

◆ SimUpdateFreeWheels()

void SimUpdateFreeWheels ( tCar car,
int  axlenb 
)

Definition at line 392 of file wheel.cpp.

◆ SimWheelConfig()

void SimWheelConfig ( tCar car,
int  index 
)

Definition at line 26 of file wheel.cpp.

Here is the call graph for this function:

◆ SimWheelReConfig()

void SimWheelReConfig ( tCar car,
int  index 
)

Definition at line 137 of file wheel.cpp.

Here is the call graph for this function:

◆ SimWheelResetWear()

void SimWheelResetWear ( tCar car,
int  index 
)

Definition at line 504 of file wheel.cpp.

◆ SimWheelUpdateForce()

void SimWheelUpdateForce ( tCar car,
int  index 
)

Definition at line 211 of file wheel.cpp.

Here is the call graph for this function:

◆ SimWheelUpdateRide()

void SimWheelUpdateRide ( tCar car,
int  index 
)

Definition at line 166 of file wheel.cpp.

Here is the call graph for this function:

◆ SimWheelUpdateRotation()

void SimWheelUpdateRotation ( tCar car)

Definition at line 373 of file wheel.cpp.

◆ SimWheelUpdateTire()

void SimWheelUpdateTire ( tCar car,
int  index 
)

Definition at line 421 of file wheel.cpp.

◆ SimWingConfig()

void SimWingConfig ( tCar car,
int  index 
)

Definition at line 110 of file aero.cpp.

Here is the call graph for this function:

◆ SimWingReConfig()

void SimWingReConfig ( tCar car,
int  index 
)

Definition at line 131 of file aero.cpp.

Here is the call graph for this function:

◆ SimWingUpdate()

void SimWingUpdate ( tCar car,
int  index,
tSituation s 
)

Definition at line 147 of file aero.cpp.

◆ urandom()

float urandom ( )
inline

return a number drawn uniformly from [0,1]

Definition at line 125 of file sim.h.

Variable Documentation

◆ rulesDamageFactor

tdble rulesDamageFactor

Definition at line 40 of file simu.cpp.

◆ rulesFuelFactor

tdble rulesFuelFactor

Definition at line 39 of file simu.cpp.

◆ rulesTireFactor

tdble rulesTireFactor

Definition at line 41 of file simu.cpp.

◆ SimCarTable

tCar* SimCarTable

Definition at line 34 of file simu.cpp.

◆ simDammageFactor

tdble simDammageFactor[]

Definition at line 30 of file categories.cpp.

◆ SimDeltaTime

tdble SimDeltaTime

Definition at line 35 of file simu.cpp.

◆ simSkidFactor

tdble simSkidFactor[]

Definition at line 32 of file categories.cpp.

◆ SimTelemetry

int SimTelemetry

Definition at line 36 of file simu.cpp.