コード例 #1
0
        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;
        }
コード例 #2
0
 private void calculateStrains(DifficultyNote previous, double timeRate)
 {
     CalculateStrain(previous, timeRate, DIFF_SPEED);
     CalculateStrain(previous, timeRate, DIFF_AIM);
 }