modelio-rs 0.2.0

Safe Rust bindings for Apple's ModelIO framework — assets, meshes, materials, lights, cameras, voxels, textures, and animation on macOS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use modelio::prelude::*;

#[test]
fn light_reports_irradiance_and_updates_type() {
    let light = Light::new().expect("light");
    light.set_light_type(LightType::Ambient);
    light
        .set_color_space("kCGColorSpaceSRGB")
        .expect("color space");

    let info = light.info().expect("info");
    let irradiance = light.irradiance_at_point([0.0, 0.0, 0.0]);

    assert_eq!(info.light_type_enum(), Some(LightType::Ambient));
    assert!(irradiance.iter().all(|value| value.is_finite()));
}