use crate::bridge::export_thread::scene_snapshot::SceneSnapshot;
use indicatrix_net::SceneState;
#[must_use]
pub(in crate::bridge::export_thread) fn scene_state_from_snapshot(
snapshot: &SceneSnapshot,
width: u32,
height: u32,
cam_yaw: f32,
cam_pitch: f32,
) -> SceneState {
SceneState {
width,
height,
yaw: cam_yaw,
pitch: cam_pitch,
distance: snapshot.distance,
light_yaw: snapshot.light_yaw,
light_pitch: snapshot.light_pitch,
exposure: snapshot.exposure,
max_bounces: snapshot.max_bounces,
lighting_preset: snapshot.lighting_preset,
material: snapshot.material.clone(),
planes: snapshot.active_planes.clone(),
girdle_frosted: !snapshot.facet_finishes.is_empty(),
backdrop: snapshot.backdrop,
surface_glare: snapshot.surface_glare,
environment: crate::bridge::remote::hdr_asset::scene_environment(snapshot.env_map.as_ref()),
}
}