1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//a Imports
use crate::{Mesh, Transformation};

//a Component
//tp Component
/// A [Component] of an object's hierarchy
///
/// Frequently an object will contain a single [Component] with no
/// transformation, just the mesh
#[derive(Debug)]
pub struct Component {
    /// The transformation to apply to the whole mesh
    pub transformation: Option<Transformation>,
    /// The mesh associated with the component
    pub mesh: Mesh,
}

//ip Component
impl Component {
    //fp new
    /// Create a new [Component]
    pub fn new(transformation: Option<Transformation>, mesh: Mesh) -> Self {
        Self {
            transformation,
            mesh,
        }
    }
}