Move Transform to math module

This commit is contained in:
SeanOMik 2023-05-14 23:21:47 -04:00
parent 1bdf51a56b
commit f8d2f7c3f1
Signed by: SeanOMik
GPG Key ID: 568F326C7EB33ACB
7 changed files with 10 additions and 25 deletions

View File

@ -1,6 +1,6 @@
use specs::{Component, DenseVecStorage}; use specs::{Component, DenseVecStorage};
use crate::render::transform::Transform; use crate::math::Transform;
#[derive(Component, Clone)] #[derive(Component, Clone)]
pub struct TransformComponent { pub struct TransformComponent {

View File

@ -120,25 +120,6 @@ impl GameLoop {
// Update the world // Update the world
self.update().await; self.update().await;
// Collect models from the ecs world
/* let mut jobs = vec![];
let world = self.world.lock().await;
let model2d_storage = world.read_storage::<Model2d>();
for model in model2d_storage.join() {
let job = RenderJob::new(&model.mesh);
jobs.push(job);
}
// drop some stuff for the borrow checker
drop(model2d_storage);
drop(world);
for job in jobs.iter() {
println!("job");
} */
let mut world = self.world.lock().await; let mut world = self.world.lock().await;
for (ent, (transform,)) in world.query_mut::<(&mut TransformComponent,)>() { for (ent, (transform,)) in world.query_mut::<(&mut TransformComponent,)>() {

View File

@ -3,3 +3,6 @@ pub use glam::*;
pub mod angle; pub mod angle;
pub use angle::*; pub use angle::*;
pub mod transform;
pub use transform::*;

View File

@ -8,4 +8,3 @@ pub mod mesh;
pub mod texture; pub mod texture;
pub mod shader_loader; pub mod shader_loader;
pub mod material; pub mod material;
pub mod transform;

View File

@ -1,6 +1,8 @@
use hecs::Entity; use hecs::Entity;
use super::{mesh::Mesh, material::Material, transform::Transform}; use crate::math::Transform;
use super::{mesh::Mesh, material::Material};
pub struct RenderJob { pub struct RenderJob {
mesh: Mesh, mesh: Mesh,

View File

@ -15,11 +15,11 @@ use hecs::{World, Entity};
use crate::ecs::components::model_2d::Model2dComponent; use crate::ecs::components::model_2d::Model2dComponent;
use crate::ecs::components::transform::TransformComponent; use crate::ecs::components::transform::TransformComponent;
use crate::math::Transform;
use crate::resources; use crate::resources;
use super::desc_buf_lay::DescVertexBufferLayout; use super::desc_buf_lay::DescVertexBufferLayout;
use super::texture::RenderTexture; use super::texture::RenderTexture;
use super::transform::Transform;
use super::{render_pipeline::FullRenderPipeline, vertex::{VERTICES}, render_buffer::BufferStorage, render_job::RenderJob, mesh::Mesh}; use super::{render_pipeline::FullRenderPipeline, vertex::{VERTICES}, render_buffer::BufferStorage, render_job::RenderJob, mesh::Mesh};
#[async_trait] #[async_trait]