moons 0.0.3

Moon celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
fn main() {
    let earth = moons::interactions::earths::ensure_earths_binary_or_simulate();

    let eclipse = moons::lighting::eclipses::typical_lunar_eclipse();
    let shader = moons::rendering::shaders::ShaderEndpoint::eclipse();

    let exposure_val = shader
        .uniforms
        .iter()
        .find(|u| u.name == "u_exposure")
        .map(|u| match u.value {
            moons::rendering::shaders::UniformValue::Float(v) => v,
            _ => 0.0,
        })
        .unwrap_or(0.0);

    let totality = eclipse.totality_duration_minutes();
    let period = earth.orbital_period_days;
    let mode_len = format!("{:?}", earth.mode).len();
    let uniform_count = shader.uniforms.len();

    assert!(totality > 0.0);
    assert!(period > 27.0);
    assert!(mode_len > 0);
    assert!(exposure_val > 0.0);
    assert!(uniform_count >= 3);
}