forked from speed-dreams/speed-dreams-code
- Fix some warning on GCC (By Robert)
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6823 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 8c9f14fd2904cf6dd4abc423fc49436421e9cc74 Former-commit-id: a57281eb8159c44840daf39a7e76377e66824d1c
This commit is contained in:
parent
bbfb0c539f
commit
7962e5eb13
4 changed files with 12 additions and 10 deletions
|
@ -41,10 +41,13 @@ CarModel::CarModel()
|
||||||
MASS(0),
|
MASS(0),
|
||||||
FUEL(0),
|
FUEL(0),
|
||||||
DAMAGE(0),
|
DAMAGE(0),
|
||||||
|
WIDTH(2),
|
||||||
TYRE_MU(0),
|
TYRE_MU(0),
|
||||||
TYRE_MU_F(0),
|
TYRE_MU_F(0),
|
||||||
TYRE_MU_R(0),
|
TYRE_MU_R(0),
|
||||||
MU_SCALE(1),
|
MU_SCALE(1),
|
||||||
|
KZ_SCALE(0),
|
||||||
|
KV_SCALE(1),
|
||||||
BRAKE_MU_SCALE(0.95),
|
BRAKE_MU_SCALE(0.95),
|
||||||
GRIP_SCALE_F(1),
|
GRIP_SCALE_F(1),
|
||||||
GRIP_SCALE_R(1),
|
GRIP_SCALE_R(1),
|
||||||
|
@ -60,9 +63,6 @@ CarModel::CarModel()
|
||||||
LF_MIN(0.8),
|
LF_MIN(0.8),
|
||||||
LF_MAX(1.6),
|
LF_MAX(1.6),
|
||||||
LF_K(log((1.0f - LF_MIN) / (LF_MAX - LF_MIN))),
|
LF_K(log((1.0f - LF_MIN) / (LF_MAX - LF_MIN))),
|
||||||
KZ_SCALE(0),
|
|
||||||
KV_SCALE(1),
|
|
||||||
WIDTH(2),
|
|
||||||
POS_AZ(0),
|
POS_AZ(0),
|
||||||
VEL_AZ(0),
|
VEL_AZ(0),
|
||||||
F_AXLE_X(1.5),
|
F_AXLE_X(1.5),
|
||||||
|
@ -75,11 +75,11 @@ CarModel::CarModel()
|
||||||
R_WING_X(-1.5),
|
R_WING_X(-1.5),
|
||||||
TARGET_SLIP(0.175), // for defaults of 30, 0.8, 0.7
|
TARGET_SLIP(0.175), // for defaults of 30, 0.8, 0.7
|
||||||
MAX_SLIP(0.27),
|
MAX_SLIP(0.27),
|
||||||
ENGINE_REV_LIMIT(8500 * 2 * PI / 60),
|
|
||||||
GEAR_CHANGE_REVS(8200 * 2 * PI / 60),
|
GEAR_CHANGE_REVS(8200 * 2 * PI / 60),
|
||||||
ENGINE_MAX_REVS(10000 * 2 * PI / 60),
|
|
||||||
DIFF_RATIO(1),
|
DIFF_RATIO(1),
|
||||||
DIFF_EFF(1),
|
DIFF_EFF(1),
|
||||||
|
ENGINE_REV_LIMIT(8500 * 2 * PI / 60),
|
||||||
|
ENGINE_MAX_REVS(10000 * 2 * PI / 60),
|
||||||
HASTYC(false),
|
HASTYC(false),
|
||||||
HASABS(false),
|
HASABS(false),
|
||||||
HASESP(false),
|
HASESP(false),
|
||||||
|
@ -974,6 +974,7 @@ double CarModel::CalcAcceleration(
|
||||||
|
|
||||||
// account for acceleration available from engine.
|
// account for acceleration available from engine.
|
||||||
double Facc = AccForceFromSpeed(avgV);
|
double Facc = AccForceFromSpeed(avgV);
|
||||||
|
|
||||||
if( Ftanroad > Facc )
|
if( Ftanroad > Facc )
|
||||||
Ftanroad = Facc;
|
Ftanroad = Facc;
|
||||||
|
|
||||||
|
@ -984,6 +985,7 @@ double CarModel::CalcAcceleration(
|
||||||
double inner = MX(0, u * u + 2 * acc * dist );
|
double inner = MX(0, u * u + 2 * acc * dist );
|
||||||
double oldV = v;
|
double oldV = v;
|
||||||
v = sqrt(inner);
|
v = sqrt(inner);
|
||||||
|
|
||||||
if( fabs(v - oldV) < 0.001 )
|
if( fabs(v - oldV) < 0.001 )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,8 +234,8 @@ void Driver::InitTrack(
|
||||||
// to come up with so far. it basically gets the name of the car .acc
|
// to come up with so far. it basically gets the name of the car .acc
|
||||||
// file, and strips off the ".acc" part, to get the name of the car. yuk.
|
// file, and strips off the ".acc" part, to get the name of the car. yuk.
|
||||||
//
|
//
|
||||||
char* path = SECT_GROBJECTS "/" LST_RANGES "/" "1";
|
const char* path = SECT_GROBJECTS "/" LST_RANGES "/" "1";
|
||||||
char* key = PRM_CAR;
|
const char* key = PRM_CAR;
|
||||||
strncpy( m_carName, GfParmGetStr(pCarHandle, path, key, ""), sizeof(m_carName) );
|
strncpy( m_carName, GfParmGetStr(pCarHandle, path, key, ""), sizeof(m_carName) );
|
||||||
char* p = strrchr(m_carName, '.');
|
char* p = strrchr(m_carName, '.');
|
||||||
if( p )
|
if( p )
|
||||||
|
|
|
@ -237,7 +237,7 @@ private:
|
||||||
clear();
|
clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if( internalBrk = 0.0 )
|
else if( internalBrk == 0.0 )
|
||||||
{
|
{
|
||||||
internalBrk = MN(-targetAcc * 0.1, 0.5);
|
internalBrk = MN(-targetAcc * 0.1, 0.5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,7 +415,7 @@ void Stuck::init( const MyTrack& track, const tSituation* s, const tCarElt* me )
|
||||||
// make opponent car cells unavailable.
|
// make opponent car cells unavailable.
|
||||||
makeOpponentsList( s, me, &_opponents );
|
makeOpponentsList( s, me, &_opponents );
|
||||||
|
|
||||||
for( int i = 0; i < _opponents.size(); i++ )
|
for( size_t i = 0; i < _opponents.size(); i++ )
|
||||||
{
|
{
|
||||||
const OppInfo& oppInfo = _opponents[i];
|
const OppInfo& oppInfo = _opponents[i];
|
||||||
const tCarElt* other = oppInfo.car;
|
const tCarElt* other = oppInfo.car;
|
||||||
|
@ -1099,7 +1099,7 @@ void Stuck::dumpGrid() const
|
||||||
{
|
{
|
||||||
set<unsigned int> pts;
|
set<unsigned int> pts;
|
||||||
|
|
||||||
for( int i = 0; i < _plan.size(); i++ )
|
for( size_t i = 0; i < _plan.size(); i++ )
|
||||||
{
|
{
|
||||||
const GridPoint& pt = _plan[i];
|
const GridPoint& pt = _plan[i];
|
||||||
pts.insert( pt.x() * 256 + pt.y() );
|
pts.insert( pt.x() * 256 + pt.y() );
|
||||||
|
|
Loading…
Reference in a new issue