font i guess?

This commit is contained in:
2021-10-13 21:53:12 +02:00
parent 00d6d1c5f8
commit db9a455311
7 changed files with 228 additions and 94 deletions

View File

@@ -11,8 +11,7 @@ use super::pipelines::vs;
#[derive(Clone)]
pub struct GameObject {
pub mesh_index: usize,
pub texture_index: TextureHandle,
pub normal_map_index: TextureHandle,
pub textures: TextureData,
pub position: Vector3<f32>,
pub rotation: Quaternion<f32>,
pub scale: Vector3<f32>,
@@ -22,9 +21,20 @@ pub struct GameObject {
pub pipeline_index: usize,
}
#[derive(Clone)]
pub struct TextureData {
pub texture_index: TextureHandle,
pub normal_map_index: TextureHandle,
}
impl GameObject {
pub fn new(mesh: MeshHandle) -> GameObject {
GameObject { mesh_index: mesh.index, texture_index: mesh.diffuse_handle, normal_map_index: mesh.normal_handle.unwrap_or(0), position: Vector3::new(0.0, 0.0, 0.0),
let textures = TextureData {
texture_index: mesh.diffuse_handle,
normal_map_index: mesh.normal_handle.unwrap_or(0),
};
GameObject { mesh_index: mesh.index, textures, position: Vector3::new(0.0, 0.0, 0.0),
rotation: Quaternion::new(1.0, 0.0, 0.0, 0.0), scale: Vector3::new(1.0, 1.0, 1.0), children: vec![],
descriptor_sets: vec![], is_selected: false, pipeline_index: mesh.pipeline_index }
}