Move Transform to math module
This commit is contained in:
parent
1bdf51a56b
commit
f8d2f7c3f1
|
@ -1,6 +1,6 @@
|
|||
use specs::{Component, DenseVecStorage};
|
||||
|
||||
use crate::render::transform::Transform;
|
||||
use crate::math::Transform;
|
||||
|
||||
#[derive(Component, Clone)]
|
||||
pub struct TransformComponent {
|
||||
|
|
19
src/game.rs
19
src/game.rs
|
@ -120,25 +120,6 @@ impl GameLoop {
|
|||
// Update the world
|
||||
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;
|
||||
|
||||
for (ent, (transform,)) in world.query_mut::<(&mut TransformComponent,)>() {
|
||||
|
|
|
@ -3,3 +3,6 @@ pub use glam::*;
|
|||
|
||||
pub mod angle;
|
||||
pub use angle::*;
|
||||
|
||||
pub mod transform;
|
||||
pub use transform::*;
|
|
@ -8,4 +8,3 @@ pub mod mesh;
|
|||
pub mod texture;
|
||||
pub mod shader_loader;
|
||||
pub mod material;
|
||||
pub mod transform;
|
|
@ -1,6 +1,8 @@
|
|||
use hecs::Entity;
|
||||
|
||||
use super::{mesh::Mesh, material::Material, transform::Transform};
|
||||
use crate::math::Transform;
|
||||
|
||||
use super::{mesh::Mesh, material::Material};
|
||||
|
||||
pub struct RenderJob {
|
||||
mesh: Mesh,
|
||||
|
|
|
@ -15,11 +15,11 @@ use hecs::{World, Entity};
|
|||
|
||||
use crate::ecs::components::model_2d::Model2dComponent;
|
||||
use crate::ecs::components::transform::TransformComponent;
|
||||
use crate::math::Transform;
|
||||
use crate::resources;
|
||||
|
||||
use super::desc_buf_lay::DescVertexBufferLayout;
|
||||
use super::texture::RenderTexture;
|
||||
use super::transform::Transform;
|
||||
use super::{render_pipeline::FullRenderPipeline, vertex::{VERTICES}, render_buffer::BufferStorage, render_job::RenderJob, mesh::Mesh};
|
||||
|
||||
#[async_trait]
|
||||
|
|
Loading…
Reference in New Issue