fix force feedback low speed constant force config menu

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7807 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: d14f9ba91cefda64e0a74b39a5063f4732610a6d
Former-commit-id: bfed64ac41160e020a801adf1c0dd0db2ace2a9e
This commit is contained in:
iobyte 2021-12-04 06:17:53 +00:00
parent 9910405692
commit a79a93edde
2 changed files with 9 additions and 9 deletions

View file

@ -227,11 +227,11 @@ int ForceFeedbackManager::updateForce(tCarElt* car, tSituation *s){
GfLogDebug("After engineRevving: (%i)\n", this->force); GfLogDebug("After engineRevving: (%i)\n", this->force);
} }
//calculate engine revving if enabled //calculate low speed constant force if enabled
//if (this->effectsConfig["engineRevvingEffect"]["enabled"]){ if (this->effectsConfig["lowSpeedConstantForceEffect"]["enabled"]){
this->force += this->lowSpeedCostantForceEffect(car, s); this->force += this->lowSpeedConstantForceEffect(car, s);
// GfLogDebug("After engineRevving: (%i)\n", this->force); GfLogDebug("After lowSpeedConstantForce: (%i)\n", this->force);
//} }
//calculate bump //calculate bump
//this->force += this->bumpsEffect(car, s); //this->force += this->bumpsEffect(car, s);
@ -442,7 +442,7 @@ int ForceFeedbackManager::engineRevvingEffect(tCarElt* car, tSituation *s)
} }
int ForceFeedbackManager::lowSpeedCostantForceEffect(tCarElt* car, tSituation *s){ int ForceFeedbackManager::lowSpeedConstantForceEffect(tCarElt* car, tSituation *s){
int effectForce; int effectForce;
int sign; int sign;
@ -482,11 +482,11 @@ int ForceFeedbackManager::lowSpeedCostantForceEffect(tCarElt* car, tSituation *s
//force calculation //force calculation
if (car->_speed_xy < this->effectsConfig["lowSpeedCostantForceEffect"]["maxSpeedAtWithcForceIsApplied"] if (car->_speed_xy < this->effectsConfig["lowSpeedConstantForceEffect"]["maxSpeedAtWhichForceIsApplied"]
// && abs(prevDirection) > 8 // && abs(prevDirection) > 8
) )
{ {
effectForce = this->effectsConfig["lowSpeedCostantForceEffect"]["maxForce"] / 8 * abs(prevDirection) / effectForce = this->effectsConfig["lowSpeedConstantForceEffect"]["maxForce"] / 8 * abs(prevDirection) /
//(car->_speed_xy + 1) * //(car->_speed_xy + 1) *
(pow(car->_speed_xy, (float) 1/2) + 1) * prevDirectionSign; (pow(car->_speed_xy, (float) 1/2) + 1) * prevDirectionSign;

View file

@ -86,7 +86,7 @@ class TGFCLIENT_API ForceFeedbackManager {
int autocenterEffect(tCarElt* car, tSituation *s); int autocenterEffect(tCarElt* car, tSituation *s);
int engineRevvingEffect(tCarElt* car, tSituation *s); int engineRevvingEffect(tCarElt* car, tSituation *s);
int bumpsEffect(tCarElt* car, tSituation *s); int bumpsEffect(tCarElt* car, tSituation *s);
int lowSpeedCostantForceEffect(tCarElt* car, tSituation *s); int lowSpeedConstantForceEffect(tCarElt* car, tSituation *s);
int globalMultiplier; int globalMultiplier;
}; };