fixed slider end_pos

This commit is contained in:
MaxOhn
2021-11-08 12:23:31 +01:00
parent cd4d89f5aa
commit 98bc687422
4 changed files with 10 additions and 8 deletions
+4 -2
View File
@@ -155,7 +155,8 @@ pub fn stars(
}
// Slider tail
let pos = h.pos + curve.position_at(1.0); // TODO: what if reversing odd amount?
let progress = (*repeats % 2 == 0) as u8 as f32;
let pos = h.pos + curve.position_at(progress);
slider_objects.push((pos, h.start_time + duration));
fruits += span_count; // TODO: +1?
@@ -386,7 +387,8 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
}
// Slider tail
let pos = curve.position_at(1.0); // TODO: what if reversing odd amount?
let progress = (*repeats % 2 == 0) as u8 as f32;
let pos = curve.position_at(progress);
slider_objects.push((pos, h.start_time + duration));
let iter = slider_objects.into_iter().map(CatchObject::new);
+2 -2
View File
@@ -54,7 +54,7 @@ fn custom_osu() {
use crate::{Beatmap, OsuPP};
let path = "E:Games/osu!/beatmaps/1402167.osu";
let path = "E:Games/osu!/beatmaps/156352_.osu";
let file = File::open(path).unwrap();
let start = Instant::now();
@@ -76,7 +76,7 @@ fn custom_osu() {
println!("Parsing average: {:?}", accum / iters);
let start = Instant::now();
let result = OsuPP::new(&map).mods(64 + 16).calculate();
let result = OsuPP::new(&map).mods(1024).calculate();
let iters = 100;
let accum = start.elapsed();
+2 -2
View File
@@ -178,8 +178,8 @@ impl OsuObject {
ticks.clear();
// TODO: what if reversing odd amount?
let mut end_pos = h.pos + curve.position_at(1.0);
let progress = (*repeats % 2 == 0) as u8 as f32;
let mut end_pos = h.pos + curve.position_at(progress);
travel_dist *= *scaling_factor;
if hr {
+2 -2
View File
@@ -161,8 +161,8 @@ impl OsuObject {
ticks.clear();
// TODO: what if reversing odd amount?
let end_pos = h.pos + curve.position_at(1.0);
let progress = (*repeats % 2 == 0) as u8 as f32;
let end_pos = h.pos + curve.position_at(progress);
travel_dist *= *scaling_factor;
Self {