2023-05-14 19:18:18 +00:00
|
|
|
use hecs::Entity;
|
|
|
|
|
2023-05-15 03:18:41 +00:00
|
|
|
use super::{mesh::Mesh, material::Material, transform::Transform};
|
2023-04-20 06:07:11 +00:00
|
|
|
|
|
|
|
pub struct RenderJob {
|
2023-05-14 19:18:18 +00:00
|
|
|
mesh: Mesh,
|
|
|
|
material: Material,
|
|
|
|
entity: Entity,
|
2023-05-15 03:18:41 +00:00
|
|
|
|
|
|
|
pub transform: Option<Transform>,
|
|
|
|
pub last_transform: Option<Transform>, // TODO: render interpolation
|
2023-04-20 06:07:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl RenderJob {
|
2023-05-15 03:18:41 +00:00
|
|
|
pub fn new(mesh: Mesh, material: Material, entity: Entity, transform: Option<Transform>, last_transform: Option<Transform>) -> Self {
|
2023-04-20 06:07:11 +00:00
|
|
|
Self {
|
|
|
|
mesh,
|
2023-05-14 19:18:18 +00:00
|
|
|
material,
|
|
|
|
entity,
|
2023-05-15 03:18:41 +00:00
|
|
|
transform,
|
|
|
|
last_transform,
|
2023-04-20 06:07:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn mesh(&self)-> &Mesh {
|
|
|
|
&self.mesh
|
|
|
|
}
|
2023-05-14 19:18:18 +00:00
|
|
|
|
|
|
|
pub fn material(&self)-> &Material {
|
|
|
|
&self.material
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn entity(&self)-> Entity {
|
|
|
|
self.entity
|
|
|
|
}
|
2023-04-20 06:07:11 +00:00
|
|
|
}
|