1
0
mirror of synced 2024-11-12 09:30:49 +01:00

Fine tune FFB and rumble

This commit is contained in:
pinkimo 2019-09-26 02:16:37 +02:00
parent 19243c1bad
commit 51e6cd2690
2 changed files with 24 additions and 15 deletions

View File

@ -22,8 +22,8 @@ MaxForce=100
DeviceGUID=
;Set to 1 if you want to enable rumble, else 0.
EnableRumble=1
; Set to 1 to generate log.txt, else 0. Logs will be appended and not cleared.
ReverseRumble=0
; Set to 1 to generate log.txt, else 0. Logs will be appended and not cleared.
Logging=0
; When a command is set that contradicts a prior command, clear the prior command. Probably should stay as 1.
ResetFeedback=1
@ -256,10 +256,10 @@ AlternativeMaxForceLeft=-100
AlternativeMinForceRight=0
AlternativeMaxForceRight=100
SpringStrength=100
FrictionStrength=20
CollisionsStrength=30
FrictionStrength=0
CollisionsStrength=100
TiresSlipStrength=100
HighhSpeedVibrationsStrength=50
HighhSpeedVibrationsStrength=100
LimitBetweenHighSpeedVibrationsAndTiresSlip=75
[Mame 0199 32bit]

View File

@ -52,23 +52,19 @@ void WMMT5::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers
{
helpers->log("collision on the left");
double percentForce = (1.0 * collisions) * CollisionsStrengthWMMT5 / 100.0;
double percentLength = (250);
// direction from right => makes wheel turn left
triggers->LeftRight(percentForce, 0, percentLength);
// triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
triggers->Sine(100, 120, percentForce);
double percentLength = (150);
triggers->LeftRight(0, percentForce, percentLength);
}
else if (0 > collisions)
{
helpers->log("collision on the right");
double percentForce = (-1.0 * collisions) * CollisionsStrengthWMMT5 / 100.0;
double percentLength = (250);
// direction from left => makes wheel turn right
triggers->LeftRight(0, percentForce, percentLength);
// triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
percentForce = (1.0 * collisions) * CollisionsStrengthWMMT5 / 100.0;
double percentForce = (1.0 * collisions) * CollisionsStrengthWMMT5 / 100.0;
triggers->Sine(100, 120, percentForce);
double percentLength = (150);
triggers->LeftRight(0, -1.0 * percentForce, percentLength);
}
if (0 < tiresSlip)
{
@ -76,6 +72,13 @@ void WMMT5::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers
bool highSpeedVibrations = (1.0 * tiresSlip) < (LimitBetweenHighSpeedVibrationsAndTiresSlipWMMT5 / 1000.0);
double percentForce = (-1.0 * tiresSlip) * (highSpeedVibrations ? HighhSpeedVibrationsStrengthWMMT5 : TiresSlipStrengthWMMT5) / 100.0;
triggers->Sine(highSpeedVibrations ? 100 : 120, 120, percentForce);
if (0 == CollisionsStrengthWMMT5 || (0.001 > collisions && -0.001 < collisions))
{
percentForce *= -1.0;
double percentLength = (150);
triggers->LeftRight(highSpeedVibrations ? percentForce : 0, highSpeedVibrations ? 0 : percentForce, percentLength);
}
}
else if (0 > tiresSlip)
{
@ -83,5 +86,11 @@ void WMMT5::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers
bool highSpeedVibrations = (-1.0 * tiresSlip) < (LimitBetweenHighSpeedVibrationsAndTiresSlipWMMT5 / 1000.0);
double percentForce = (-1.0 * tiresSlip) * (highSpeedVibrations ? HighhSpeedVibrationsStrengthWMMT5 : TiresSlipStrengthWMMT5) / 100.0;
triggers->Sine(highSpeedVibrations ? 100 : 120, 120, percentForce);
if (0 == CollisionsStrengthWMMT5 || (0.001 > collisions && -0.001 < collisions))
{
double percentLength = (150);
triggers->LeftRight(highSpeedVibrations ? percentForce : 0, highSpeedVibrations ? 0 : percentForce, percentLength);
}
}
}