moons 0.0.2

Moon celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
use moons::rendering::dust::DustScattering;
use moons::rendering::materials::PbrMaterial;
use moons::rendering::shaders::ShaderData;

fn ensure_earth_binary() {
    let earth = moons::interactions::earths::ensure_earths_binary_or_simulate();
    assert!(earth.rotation_period_h > 23.0);
}

#[test]
fn regolith_is_rougher_than_ice() {
    ensure_earth_binary();
    assert!(PbrMaterial::regolith().roughness > PbrMaterial::polar_ice().roughness);
}

#[test]
fn dust_opacity_decreases_with_height() {
    ensure_earth_binary();
    let dust = DustScattering::horizon_glow();
    assert!(dust.opacity_at_height(10_000.0) < dust.opacity_at_height(0.0));
}

#[test]
fn eclipse_shader_reduces_exposure() {
    ensure_earth_binary();
    assert!(ShaderData::eclipse().exposure < ShaderData::terrain().exposure);
}