forked from speed-dreams/speed-dreams-code
Rename SIM_SUSP_INAIR to SIM_WH_INAIR and solve a conflict with SIM_WH_SPINNING
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6202 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: e7ffbc9b3ea8ec7a6c7118ef337892a34bdc4332 Former-commit-id: 3018af0f192fa91adf9ed2d0a6e9f5c4ca33f74a
This commit is contained in:
parent
e740f876f3
commit
ef4c071cfb
3 changed files with 6 additions and 3 deletions
|
@ -56,9 +56,10 @@ typedef struct Suspension
|
||||||
|
|
||||||
tdble force; /* generated force */
|
tdble force; /* generated force */
|
||||||
int state; /* indicate the state of the suspension */
|
int state; /* indicate the state of the suspension */
|
||||||
|
/* Note: susp.state is merged with wheel.state in the code,
|
||||||
|
* so SIM_SUSP and SIM_WH states cannot use the same bit */
|
||||||
#define SIM_SUSP_COMP 1 /* the suspension is fully compressed */
|
#define SIM_SUSP_COMP 1 /* the suspension is fully compressed */
|
||||||
#define SIM_SUSP_EXT 2 /* the suspension is fully extended */
|
#define SIM_SUSP_EXT 2 /* the suspension is fully extended */
|
||||||
#define SIM_SUSP_INAIR 4 /* the suspension is in the air, can be combined with the other states */
|
|
||||||
} tSuspension;
|
} tSuspension;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ SimWheelConfig(tCar *car, int index)
|
||||||
tireratio = GfParmGetNum(hdle, WheelSect[index], PRM_TIRERATIO, (char*)NULL, 0.75f);
|
tireratio = GfParmGetNum(hdle, WheelSect[index], PRM_TIRERATIO, (char*)NULL, 0.75f);
|
||||||
wheel->mu = GfParmGetNum(hdle, WheelSect[index], PRM_MU, (char*)NULL, 1.0f);
|
wheel->mu = GfParmGetNum(hdle, WheelSect[index], PRM_MU, (char*)NULL, 1.0f);
|
||||||
wheel->I = GfParmGetNum(hdle, WheelSect[index], PRM_INERTIA, (char*)NULL, 1.5f);
|
wheel->I = GfParmGetNum(hdle, WheelSect[index], PRM_INERTIA, (char*)NULL, 1.5f);
|
||||||
|
//BUG: the next line should go after SimBrakeConfig to have an effect
|
||||||
wheel->I += wheel->brake.I; // add brake inertia
|
wheel->I += wheel->brake.I; // add brake inertia
|
||||||
wheel->staticPos.y = GfParmGetNum(hdle, WheelSect[index], PRM_YPOS, (char*)NULL, 0.0f);
|
wheel->staticPos.y = GfParmGetNum(hdle, WheelSect[index], PRM_YPOS, (char*)NULL, 0.0f);
|
||||||
x0 = GfParmGetNum(hdle, WheelSect[index], PRM_RIDEHEIGHT, (char*)NULL, 0.20f);
|
x0 = GfParmGetNum(hdle, WheelSect[index], PRM_RIDEHEIGHT, (char*)NULL, 0.20f);
|
||||||
|
@ -162,7 +163,7 @@ void SimWheelUpdateRide(tCar *car, int index)
|
||||||
|
|
||||||
if (car->features & FEAT_FIXEDWHEELFORCE) {
|
if (car->features & FEAT_FIXEDWHEELFORCE) {
|
||||||
if (max_extend > new_susp_x + 0.01) {
|
if (max_extend > new_susp_x + 0.01) {
|
||||||
wheel->susp.state = SIM_SUSP_INAIR;
|
wheel->susp.state = SIM_WH_INAIR;
|
||||||
} else {wheel->susp.state = 0;}
|
} else {wheel->susp.state = 0;}
|
||||||
} else {
|
} else {
|
||||||
wheel->susp.state = 0;
|
wheel->susp.state = 0;
|
||||||
|
@ -222,7 +223,7 @@ void SimWheelUpdateForce(tCar *car, int index)
|
||||||
SimSuspUpdate(&(wheel->susp));
|
SimSuspUpdate(&(wheel->susp));
|
||||||
// check suspension state
|
// check suspension state
|
||||||
wheel->state |= wheel->susp.state;
|
wheel->state |= wheel->susp.state;
|
||||||
if ( ((wheel->state & SIM_SUSP_EXT) == 0) && ((wheel->state & SIM_SUSP_INAIR) == 0) ) {
|
if ( ((wheel->state & SIM_SUSP_EXT) == 0) && ((wheel->state & SIM_WH_INAIR) == 0) ) {
|
||||||
wheel->forces.z = axleFz + wheel->susp.force + wheel->axleFz3rd;
|
wheel->forces.z = axleFz + wheel->susp.force + wheel->axleFz3rd;
|
||||||
reaction_force = wheel->forces.z;
|
reaction_force = wheel->forces.z;
|
||||||
if (car->features & FEAT_FIXEDWHEELFORCE) {
|
if (car->features & FEAT_FIXEDWHEELFORCE) {
|
||||||
|
|
|
@ -47,6 +47,7 @@ typedef struct
|
||||||
/* 1 and 2 are for suspension state */
|
/* 1 and 2 are for suspension state */
|
||||||
#define SIM_WH_SPINNING 4 /* the wheel is spinning */
|
#define SIM_WH_SPINNING 4 /* the wheel is spinning */
|
||||||
#define SIM_WH_LOCKED 8 /* the wheel is locked */
|
#define SIM_WH_LOCKED 8 /* the wheel is locked */
|
||||||
|
#define SIM_WH_INAIR 16 /* the wheel is in the air */
|
||||||
tdble axleFz; /* force from axle (anti-roll bar) */
|
tdble axleFz; /* force from axle (anti-roll bar) */
|
||||||
tdble axleFz3rd; /* force from axle (3rd/heave spring) */
|
tdble axleFz3rd; /* force from axle (3rd/heave spring) */
|
||||||
tTrkLocPos trkPos; /* current track position */
|
tTrkLocPos trkPos; /* current track position */
|
||||||
|
|
Loading…
Reference in a new issue