/** * @brief Increases the current rumble level. * * Rumble will decay over time. * * @param mod Modifier to increase level by. */ void spfx_shake( double mod ) { /* Add the modifier. */ shake_force_mod += mod; if (shake_force_mod > SHAKE_MAX) shake_force_mod = SHAKE_MAX; /* Rumble if it wasn't rumbling before. */ spfx_hapticRumble(mod); /* Notify that rumble is active. */ shake_off = 0; }
/** * @brief Increases the current rumble level. * * Rumble will decay over time. * * @param mod Modifier to increase level by. */ void spfx_shake( double mod ) { /* Add the modifier. */ shake_rad += mod; if (shake_rad > SHAKE_MAX) shake_rad = SHAKE_MAX; vect_pset( &shake_vel, SHAKE_VEL_MOD*shake_rad, RNGF() * 2. * M_PI ); /* Rumble if it wasn't rumbling before. */ spfx_hapticRumble(mod); /* Notify that rumble is active. */ shake_off = 0; }