lyra-engine/lyra-resource/src/model.rs

35 lines
581 B
Rust
Raw Normal View History

2023-09-21 18:22:46 +00:00
#[repr(C)]
#[derive(Copy, Clone, Debug)]
pub struct Vertex {
2023-09-22 03:11:09 +00:00
pub position: glam::Vec3,
pub tex_coords: glam::Vec2
}
impl Vertex {
pub fn new(position: glam::Vec3, tex_coords: glam::Vec2) -> Self {
Self {
position,
tex_coords,
}
}
2023-09-21 18:22:46 +00:00
}
2023-09-21 21:27:21 +00:00
#[derive(Clone, Default)]
2023-09-21 18:22:46 +00:00
pub struct Mesh {
pub vertices: Vec<Vertex>,
2023-09-22 03:11:09 +00:00
pub indices: Option<Vec<u32>>,
2023-09-21 18:22:46 +00:00
}
pub struct Model {
2023-09-22 03:11:09 +00:00
pub meshes: Vec<Mesh>,
2023-09-21 18:22:46 +00:00
//pub material
2023-09-22 03:11:09 +00:00
}
impl Model {
pub fn new(meshes: Vec<Mesh>) -> Self {
Self {
meshes,
}
}
2023-09-21 18:22:46 +00:00
}