From f2ba6ebbc002fe708f7d69d4ca2e008b3437cbda Mon Sep 17 00:00:00 2001 From: core Date: Sun, 6 Jul 2025 20:43:46 -0400 Subject: [PATCH] fix: make it compile :p --- crates/unified/assets/config/world.wc.toml | 2 +- crates/unified/src/particle_editor/mod.rs | 16 +++++++--------- crates/unified/src/particles.rs | 6 +++--- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/crates/unified/assets/config/world.wc.toml b/crates/unified/assets/config/world.wc.toml index 1b26b6e48dbde6cbd53060553483404520ddb09f..e68a111ac162ad8fc45d2aaade393eb6632a6204 100644 --- a/crates/unified/assets/config/world.wc.toml +++ b/crates/unified/assets/config/world.wc.toml @@ -10,4 +10,4 @@ default_mass = 100 [hearty] thrust = 50000 -spawn_at = "Sun" +spawn_at = "Earth" diff --git a/crates/unified/src/particle_editor/mod.rs b/crates/unified/src/particle_editor/mod.rs index 2e33fd8c3ec942cc24accd9aba64af1e41a4774f..a6ce33835566152a3386e727b513f84e10e5f286 100644 --- a/crates/unified/src/particle_editor/mod.rs +++ b/crates/unified/src/particle_editor/mod.rs @@ -27,20 +27,18 @@ fn setup_editor_effect(mut commands: Commands) { }, initial_angular_velocity: RandF32 { value: 1.0, randomness: 0.5 }, scale: LifetimeCurve::new(&[ - (0.0, 5.0), + (0.0f32, 5.0), (2.0, 0.0) ]), color: LifetimeCurve::new(&[ - (0.0, Srgba::new(1.0, 0.0, 0.0, 1.0)), - (0.5, Srgba::new(0.0, 1.0, 0.0, 1.0)), - (1.0, Srgba::new(0.0, 0.0, 1.0, 1.0)), - (1.5, Srgba::new(1.0, 0.0, 1.0, 1.0)), - (2.0, Srgba::new(1.0, 1.0, 1.0, 1.0)) + (0.0f32, Srgba::new(1.0, 0.0, 0.0, 1.0).into()), + (0.5, Srgba::new(0.0, 1.0, 0.0, 1.0).into()), + (1.0, Srgba::new(0.0, 0.0, 1.0, 1.0).into()), + (1.5, Srgba::new(1.0, 0.0, 1.0, 1.0).into()), + (2.0, Srgba::new(1.0, 1.0, 1.0, 1.0).into()) ]), } )); } -fn editor_ui(app: &mut App) { - -} \ No newline at end of file +fn editor_ui() {} \ No newline at end of file diff --git a/crates/unified/src/particles.rs b/crates/unified/src/particles.rs index ff6cb2a9c0053fd3fface38024cfa78cc0bcd312..e48118b8dfb05e64f973efad8251199a84180b91 100644 --- a/crates/unified/src/particles.rs +++ b/crates/unified/src/particles.rs @@ -39,9 +39,9 @@ pub struct ParticleEffect { #[derive(Serialize, Deserialize)] pub struct LifetimeCurve(BTreeMap, P>); -impl LifetimeCurve

{ - pub fn new(points: impl IntoIterator) -> Self { - Self(BTreeMap::from_iter(points.into_iter().map(|u| (OrderedFloat(u.0), u.1)))) +impl LifetimeCurve

{ + pub fn new<'a>(points: impl IntoIterator) -> Self where P: 'a { + Self(BTreeMap::from_iter(points.into_iter().map(|u| (OrderedFloat(u.0), u.1.clone())))) } /// Sample for the value at T. Returns None if the curve has no points, or if T is outside