private void CalculateStrain(DifficultyNote previous, double timeRate, byte difficultyType) { double res = 0; double timeElapsed = (note.time - previous.note.time) / timeRate; double decay = Math.Pow(DECAY_BASE[difficultyType], timeElapsed / 1000f); double scaling = WEIGHT_SCALING[difficultyType]; double distance = Vector2.Distance(normStart, previous.normStart); res = SpacingWeight(distance, difficultyType) * scaling; res /= Math.Max(timeElapsed, 50); strains[difficultyType] = previous.strains[difficultyType] * decay + res; }
private void calculateStrains(DifficultyNote previous, double timeRate) { CalculateStrain(previous, timeRate, DIFF_SPEED); CalculateStrain(previous, timeRate, DIFF_AIM); }