it works again!!
This commit is contained in:
@@ -8,11 +8,7 @@ use crate::input::InputState;
|
||||
use crate::vulkan::TextureHandle;
|
||||
use crate::vulkan::{MeshHandle, VulkanRenderer};
|
||||
|
||||
use super::pipelines::{vs, vs_text};
|
||||
|
||||
pub trait PushConstant {}
|
||||
impl PushConstant for vs::ty::PushConstants {}
|
||||
impl PushConstant for vs_text::ty::PushConstants {}
|
||||
use super::pipelines::vs;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct GameObject {
|
||||
@@ -28,6 +24,10 @@ pub struct GameObject {
|
||||
pub visible: bool,
|
||||
}
|
||||
|
||||
pub enum PushConstantType {
|
||||
MeshPC(vs::ty::PushConstants),
|
||||
}
|
||||
|
||||
impl GameObject {
|
||||
pub fn new(mesh: MeshHandle) -> GameObject {
|
||||
GameObject { mesh_index: mesh.index, textures: mesh.textures, position: Vector3::new(0.0, 0.0, 0.0),
|
||||
@@ -65,8 +65,8 @@ impl GameObject {
|
||||
self.rotation = self.rotation * Quaternion::from(Euler::new(Deg(x), Deg(y), Deg(z)));
|
||||
}
|
||||
|
||||
pub fn get_push_constants(&self) -> Box<dyn PushConstant> {
|
||||
Box::new(vs::ty::PushConstants {
|
||||
pub fn get_push_constants(&self) -> PushConstantType {
|
||||
PushConstantType::MeshPC(vs::ty::PushConstants {
|
||||
model: self.get_model_matrix().into(),
|
||||
is_selected: if self.is_selected { 1 } else { 0 },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user