mod3d_base/
component.rs

1//a Imports
2use crate::{Mesh, Transformation};
3
4//a Component
5//tp Component
6/// A [Component] of an object's hierarchy
7///
8/// Frequently an object will contain a single [Component] with no
9/// transformation, just the mesh
10#[derive(Debug)]
11pub struct Component {
12    /// The transformation to apply to the whole mesh
13    pub transformation: Option<Transformation>,
14    /// The mesh associated with the component
15    pub mesh: Mesh,
16}
17
18//ip Component
19impl Component {
20    //fp new
21    /// Create a new [Component]
22    pub fn new(transformation: Option<Transformation>, mesh: Mesh) -> Self {
23        Self {
24            transformation,
25            mesh,
26        }
27    }
28}