if(a->hasAttribute("compression"))
eng->setCompression(attrf(a, "compression"));
+ if(a->hasAttribute("min-throttle"))
+ eng->setMinThrottle(attrf(a, "min-throttle"));
+
if(a->hasAttribute("turbo-mul")) {
float mul = attrf(a, "turbo-mul");
float mp = attrf(a, "wastegate-mp", 1e6) * INHG2PA;
_mixCoeff = realFlow * 1.1f / _omega0;
_turbo = 1;
+ _minthrottle = 0.1;
_maxMP = 1e6; // No waste gate on non-turbo engines.
_wastegate = 1;
_charge = 1;
_compression = c;
}
+void PistonEngine::setMinThrottle(float m)
+{
+ _minthrottle = m;
+}
+
float PistonEngine::getMaxPower()
{
return _power0;
// We need to adjust the minimum manifold pressure to get a
// reasonable idle speed (a "closed" throttle doesn't suck a total
// vacuum in real manifolds). This is a hack.
- float _minMP = (-0.008 * _turbo ) + 0.1;
+ float _minMP = (-0.008 * _turbo ) + _minthrottle;
_mp = pressure * _charge;
void setTurboParams(float mul, float maxMP);
void setDisplacement(float d);
void setCompression(float c);
+ void setMinThrottle(float m);
void setWastegate(float norm) { _wastegate = norm; }
void setSupercharger(bool hasSuper) { _hasSuper = hasSuper; }
void setTurboLag(float lag) { _turboLag = lag; }
float _wastegate; // wastegate setting, [0:1]
float _displacement; // piston stroke volume
float _compression; // compression ratio (>1)
+ float _minthrottle; // minimum throttle [0:1]
// Runtime state/output:
float _mp;