~starkingdoms/starkingdoms

f2ba6ebbc002fe708f7d69d4ca2e008b3437cbda — core 5 months ago 321ab93
fix: make it compile :p
M crates/unified/assets/config/world.wc.toml => crates/unified/assets/config/world.wc.toml +1 -1
@@ 10,4 10,4 @@ default_mass = 100

[hearty]
thrust = 50000
spawn_at = "Sun"
spawn_at = "Earth"

M crates/unified/src/particle_editor/mod.rs => crates/unified/src/particle_editor/mod.rs +7 -9
@@ 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

M crates/unified/src/particles.rs => crates/unified/src/particles.rs +3 -3
@@ 39,9 39,9 @@ pub struct ParticleEffect {

#[derive(Serialize, Deserialize)]
pub struct LifetimeCurve<P: Lerp>(BTreeMap<OrderedFloat<f32>, P>);
impl<P: Lerp> LifetimeCurve<P> {
    pub fn new(points: impl IntoIterator<Item = (f32, P)>) -> Self {
        Self(BTreeMap::from_iter(points.into_iter().map(|u| (OrderedFloat(u.0), u.1))))
impl<P: Lerp + Copy> LifetimeCurve<P> {
    pub fn new<'a>(points: impl IntoIterator<Item = &'a (f32, P)>) -> 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