lyra-engine/src/render/render_job.rs

38 lines
783 B
Rust
Raw Normal View History

use hecs::Entity;
2023-05-15 03:21:47 +00:00
use crate::math::Transform;
use super::{mesh::Mesh, material::Material};
2023-04-20 06:07:11 +00:00
pub struct RenderJob {
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,
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
}
pub fn material(&self)-> &Material {
&self.material
}
pub fn entity(&self)-> Entity {
self.entity
}
2023-04-20 06:07:11 +00:00
}