Skip to main content

engvis_core/
scene.rs

1use glam::Affine3A;
2use crate::light::LightingEnvironment;
3use crate::material::PbrMaterial;
4use crate::mesh::Mesh;
5
6/// A scene node with transform
7#[derive(Debug)]
8pub struct SceneNode {
9    pub name: String,
10    pub local_transform: Affine3A,
11    pub mesh_index: Option<usize>,
12    pub children: Vec<SceneNode>,
13    pub visible: bool,
14}
15
16/// The top-level scene containing all data
17#[derive(Debug)]
18pub struct Scene {
19    pub meshes: Vec<Mesh>,
20    pub materials: Vec<PbrMaterial>,
21    pub nodes: Vec<SceneNode>,
22    pub lighting: LightingEnvironment,
23}
24
25impl Default for Scene {
26    fn default() -> Self {
27        Self {
28            meshes: Vec::new(),
29            materials: vec![PbrMaterial::default()],
30            nodes: Vec::new(),
31            lighting: LightingEnvironment::default(),
32        }
33    }
34}