Update snocross
This commit is contained in:
parent
3c2506d1d7
commit
093073ca8c
@ -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) {
|
void SnoCross::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
|
||||||
|
|
||||||
float ff = helpers->ReadFloat32(0x99AB6C, false);
|
float ff = helpers->ReadFloat32(0x99AB6C, false);
|
||||||
|
static float oldff = 0;
|
||||||
|
float newff = ff;
|
||||||
|
|
||||||
helpers->log("got value: ");
|
helpers->log("got value: ");
|
||||||
std::string ffs = std::to_string(ff);
|
std::string ffs = std::to_string(ff);
|
||||||
helpers->log((char*)ffs.c_str());
|
helpers->log((char*)ffs.c_str());
|
||||||
|
|
||||||
if (ff > 0)
|
if (oldff != newff)
|
||||||
{
|
{
|
||||||
double percentForce = ff / 1.24;
|
if (ff > 0)
|
||||||
double percentLength = 100;
|
{
|
||||||
triggers->Rumble(percentForce, 0, percentLength);
|
double percentForce = ff / 1.2401;
|
||||||
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
|
double percentLength = 100;
|
||||||
}
|
triggers->Rumble(0, percentForce, percentLength);
|
||||||
else if (ff < 0)
|
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
|
||||||
{
|
}
|
||||||
double percentForce = -ff / 1.24;
|
else if (ff < 0)
|
||||||
double percentLength = 100;
|
{
|
||||||
triggers->Rumble(0, percentForce, percentLength);
|
double percentForce = -ff / 1.2401;
|
||||||
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
|
double percentLength = 100;
|
||||||
|
triggers->Rumble(percentForce, 0, percentLength);
|
||||||
|
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
oldff = newff;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user