1
0
mirror of synced 2024-11-23 22:40:57 +01:00

Update snocross

This commit is contained in:
Aaron M 2020-01-09 15:18:26 +13:00
parent 3c2506d1d7
commit 093073ca8c

View File

@ -17,23 +17,29 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
void SnoCross::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
float ff = helpers->ReadFloat32(0x99AB6C, false);
static float oldff = 0;
float newff = ff;
helpers->log("got value: ");
std::string ffs = std::to_string(ff);
helpers->log((char*)ffs.c_str());
if (ff > 0)
if (oldff != newff)
{
double percentForce = ff / 1.24;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else if (ff < 0)
{
double percentForce = -ff / 1.24;
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
if (ff > 0)
{
double percentForce = ff / 1.2401;
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
}
else if (ff < 0)
{
double percentForce = -ff / 1.2401;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
}
oldff = newff;
}