private void FixedUpdate() { try { if (!physicsUpdateInProgress && (breastMorphListener.Changed() || atomScaleListener.Changed())) { StartCoroutine(RefreshStaticPhysics()); } float roll = AngleCalc.Roll(chest.rotation); float pitch = AngleCalc.Pitch(chest.rotation); float scaleVal = breastMassCalculator.LegacyScale(massEstimate); gravityMorphH.Update(roll, pitch, scaleVal, gravityLogAmount); gravityPhysicsH.Update(roll, pitch, scaleVal, Const.ConvertToLegacyVal(gravity.val)); #if DEBUG_PHYSICS || DEBUG_MORPHS SetBaseDebugInfo(roll, pitch); #endif #if DEBUG_PHYSICS physicsDebugInfo.SetVal(staticPhysicsH.GetStatus() + gravityPhysicsH.GetStatus()); #elif DEBUG_MORPHS morphDebugInfo.SetVal(gravityMorphH.GetStatus()); #endif } catch (Exception e) { Log.Error($"{e}"); Log.Error($"Try reloading plugin!"); enabled = false; } }
private void UpdateLogarithmicGravityAmount(float val) { gravityLogAmount = Mathf.Log(10 * Const.ConvertToLegacyVal(val) - 3.35f); }