dreamwell-engine 1.0.0

Dreamwell pure-logic engine library — transforms, hierarchy, canon pipeline, spatial math, hashing, tile rules, validation, waymark schema, material/lighting descriptors. No SpacetimeDB dependency.
Documentation
use super::*;
use crate::physics::emitter::*;

fn base_entry(id: &str, name: &str) -> PresetCatalogEntry {
    PresetCatalogEntry {
        id: id.into(),
        name: name.into(),
        family: PresetFamily::Particle,
        authority: AuthorityProfile::VisualOnly,
        semantics: SemanticBinding::default(),
        shape: SpawnShape::Point,
        spawn: SpawnPolicy {
            mode: SpawnMode::Continuous,
            rate_per_sec: 20.0,
            burst_count: 0,
            max_live: 100,
            warmup_seconds: 0.0,
            looped: true,
            seed: 0,
            density_scale_lod: true,
        },
        initialize: InitPolicy::default(),
        simulate: SimPolicy {
            mode: crate::physics::classes::SimulationMode::Full,
            gravity: [0.0, -2.0, 0.0],
            drag: 0.05,
            damping: 0.02,
            noise: None,
            forces: vec![],
            lifetime: LifetimePolicy {
                seconds: 2.0,
                random_range: None,
            },
            behaviors: vec![],
        },
        collision: CollisionPolicy::default(),
        render: RenderPolicy::default(),
        promotion: PromotionPolicy::default(),
        budgets: BudgetPolicy::default(),
        replication: ReplicationPolicy::default(),
        supported_views: vec![RepresentationMode::World3D],
        tags: vec!["particle".into()],
    }
}

pub fn catalog() -> Vec<PresetCatalogEntry> {
    vec![
        {
            let mut e = base_entry("particle_ambient_motes", "Ambient Motes");
            e.spawn.rate_per_sec = 10.0;
            e.simulate.gravity = [0.0, 0.5, 0.0];
            e
        },
        {
            let mut e = base_entry("particle_sparkle", "Sparkle");
            e.spawn.rate_per_sec = 30.0;
            e.simulate.lifetime.seconds = 0.8;
            e
        },
    ]
}