fix a bug with global rotation

This commit is contained in:
2025-05-31 21:13:06 +02:00
parent 876ae43948
commit 06a3bd26d8
2 changed files with 5 additions and 9 deletions

View File

@@ -52,8 +52,9 @@ impl MyApp {
teta: 0.0,
polygons: vec![
//Polygon::n_gon(0.0, 12),
Polygon::triangle(0.0),
Polygon::square(PI / 4.0),
//Polygon::triangle(0.0),
//Polygon::square(PI / 4.0),
Polygon::nr_6_in_30(1.5),
],
},
},
@@ -76,7 +77,6 @@ impl MyApp {
* (1.0 / self.nb_sec_for_rev as f32)
* (time_btw.as_millis() as f32 / 1_000.0);
self.polys.teta %= 2.0 * PI;
//println!("Teta : {}", self.polys.teta);
if self
.polys
.have_point_polygon_btw(teta_temp, self.polys.teta)
@@ -84,7 +84,6 @@ impl MyApp {
self.audio_manager
.play(self.default_sound.clone())
.expect("Error to play sound");
//do_sound("assets/tick.mp3");
}
self.time_last_frame = Instant::now();
}
@@ -109,7 +108,7 @@ impl MyApp {
.into()
}
fn subscription(&self) -> iced::Subscription<Message> {
time::every(Duration::from_millis(1)).map(|_| Message::Tick)
time::every(Duration::from_millis(16)).map(|_| Message::Tick)
}
}
/*