TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
wheel.h
Go to the documentation of this file.
1/***************************************************************************
2
3 file : wheel.h
4 created : Sun Mar 19 00:09:18 CET 2000
5 copyright : (C) 2000-2017 by Eric Espie, Bernhard Wymann
6 email : torcs@free.fr
7 version : $Id$
8
9 ***************************************************************************/
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
20#ifndef _WHEEL_H__
21#define _WHEEL_H__
22
23#include "differential.h"
24
25typedef struct
26{
27
28 /* internal data */
29 tSuspension susp; /* associated suspension */
30 tBrake brake; /* associated brake disk */
31
32 /* dynamic */
33 t3Dd forces; /* forces acting on car */
34 tdble rollRes; /* Rolling Resistance (summed over the car) */
35 tdble rideHeight; /* height of the bottom of the car */
36 tdble zRoad; /* z of the road */
37 double worldPosX; /* high-precision world position for track contact */
38 double worldPosY;
40 t3Dd bodyVel; /* world related */
41 tdble driveTq; /* engine torque */
43
44 tdble spinTq; /* spin torque feedback */
45 tdble spinVel; /* spin velocity */
46 tdble prespinVel; /* spin velocity */
47 int state; /* wheel state */
48 /* 1 and 2 are for suspension state */
49#define SIM_WH_ONAIR 4 /* the wheel has no contact to the ground although the suspension is not fully extended */
50 tdble axleFz; /* force from axle (anti-roll bar) */
51 tTrkLocPos trkPos; /* current track position */
52 t3Dd surfaceNormal; // Normal of the surface under this wheel
53 tPosd relPos; /* relative pos / GC */
54 tdble sa; /* slip angle */
55 tdble sx; /* longitudinal slip value */
57
58 /* static */
59 tPosd staticPos; /* pos relative to the GC (z is suspension travel at rest) */
60 /* and angles are camber (ax), caster (ay) and toe (az) */
62
63 tdble weight0; /* initial weight on this wheel */
67 tdble I; /* I = inertial moment of the wheel */
68 tdble curI; /* Current inertia for the wheel (including transmission) */
69 tdble mfC; /* Magic Formula C coeff */
70 tdble mfB; /* Magic Formula B coeff */
71 tdble mfE; /* Magic Formula E coeff */
72 tdble lfMax; /* Load factor */
73 tdble lfMin; /* Load factor */
74 tdble lfK; /* Load factor */
75 tdble opLoad; /* Operating load */
76 tdble mass; /* total wheel mass (incl. brake) (unsprung mass) */
77 tdble camber; /* camber, negative toward exterior on both sides */
78 tdble pressure; /* initial tire pressure, environment temperature */
79 tdble rel_vel; /* relative velocity - used for realstic suspension movement*/
80 tdble tirewidth; /* width of tire, used for surface property blending */
81
84
86
87 // Additional parameters for the tire wear model
88 tdble treadMass; // Initial mass of the tread
89 tdble baseMass; // Mass of the tire minus the tread
90 tdble treadThinkness; // Thinkness of the initial tread (brand new tire)
91 tdble tireGasMass; // Mass of the gas in the tire (constant)
92 tdble tireConvectionSurface; // Surface area regarding the convection model
93 tdble initialTemperature; // Initial temperature of the tire (initial pressure, p0/T0=constant)
94 tdble hysteresisFactor; // Factor to adjust the hysteresis (model fitting), usually close to 1.0.
95 tdble wearFactor; // Factor to adjust the wear (model fitting), usually close to 1.0.
96 tdble idealTemperature; // Ideal tire temperature for best grip.
97
98 // Dynamic Tire properties (temp, wear, etc.)
99 tdble currentPressure; // current tire pressure considering temperature
100 tdble currentTemperature; // current temperature
101 double currentWear; // [0..1], 1 means totally worn (tread thickness 0)
102 tdble currentGraining; // [0..1], 1 means totally grained
103 tdble currentGripFactor; // [0..1], 1 means best grip
104
105 tdble tireSlip; // Slip of the tire from tire model calculation
106 tdble tireZForce; // Force on tire
107
108} tWheel;
109
110
111
112#endif /* _WHEEL_H__ */
113
114
115
float tdble
Floating point type used in TORCS.
Definition tgf.h:47
3D point.
Definition tgf.h:114
Definition brake.h:23
6 DOF position.
Definition tgf.h:129
Location on the track in local coordinates.
Definition track.h:434
Definition wheel.h:26
tdble rollRes
Definition wheel.h:34
tdble currentPressure
Definition wheel.h:99
double worldPosX
Definition wheel.h:37
double currentWear
Definition wheel.h:101
tdble radius
Definition wheel.h:65
tdble sa
Definition wheel.h:54
tBrake brake
Definition wheel.h:30
tdble lfK
Definition wheel.h:74
tdble lfMax
Definition wheel.h:72
tdble I
Definition wheel.h:67
tdble initialTemperature
Definition wheel.h:93
tdble tireConvectionSurface
Definition wheel.h:92
tdble prespinVel
Definition wheel.h:46
tdble currentGripFactor
Definition wheel.h:103
tDynAxis in
Definition wheel.h:82
double worldPosY
Definition wheel.h:38
t3Dd forces
Definition wheel.h:33
tdble tireSlip
Definition wheel.h:105
tdble mass
Definition wheel.h:76
tPosd staticPos
Definition wheel.h:59
tdble currentGraining
Definition wheel.h:102
tdble steer
Definition wheel.h:56
tdble pressure
Definition wheel.h:78
int state
Definition wheel.h:47
tSuspension susp
Definition wheel.h:29
tdble opLoad
Definition wheel.h:75
tdble driveTq
Definition wheel.h:41
tdble sx
Definition wheel.h:55
tdble rideHeight
Definition wheel.h:35
tdble hysteresisFactor
Definition wheel.h:94
t3Dd surfaceNormal
Definition wheel.h:52
tdble mfB
Definition wheel.h:70
tDynAxis feedBack
Definition wheel.h:83
tdble lfMin
Definition wheel.h:73
tdble camber
Definition wheel.h:77
tdble preFt
Definition wheel.h:85
tdble preFn
Definition wheel.h:85
tdble curI
Definition wheel.h:68
tdble idealTemperature
Definition wheel.h:96
tdble currentTemperature
Definition wheel.h:100
tdble tireGasMass
Definition wheel.h:91
tdble vt
Definition wheel.h:42
tdble worldPosZ
Definition wheel.h:39
tdble mu
Definition wheel.h:66
tdble rel_vel
Definition wheel.h:79
tdble baseMass
Definition wheel.h:89
tdble spinVel
Definition wheel.h:45
tdble axleFz
Definition wheel.h:50
tdble tirewidth
Definition wheel.h:80
tPosd relPos
Definition wheel.h:53
tdble mfC
Definition wheel.h:69
tdble mfE
Definition wheel.h:71
tdble tireZForce
Definition wheel.h:106
tdble weight0
Definition wheel.h:63
tTrkLocPos trkPos
Definition wheel.h:51
tdble tireSpringRate
Definition wheel.h:64
tdble rollCenter
Definition wheel.h:61
tdble spinTq
Definition wheel.h:44
tdble treadMass
Definition wheel.h:88
t3Dd bodyVel
Definition wheel.h:40
tdble treadThinkness
Definition wheel.h:90
tdble zRoad
Definition wheel.h:36
tdble wearFactor
Definition wheel.h:95
struct Suspension tSuspension