Move Transform to math module
This commit is contained in:
parent
836afe2c0e
commit
77d29d68c8
|
@ -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 {
|
||||||
|
|
19
src/game.rs
19
src/game.rs
|
@ -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,)>() {
|
||||||
|
|
|
@ -2,4 +2,7 @@
|
||||||
pub use glam::*;
|
pub use glam::*;
|
||||||
|
|
||||||
pub mod angle;
|
pub mod angle;
|
||||||
pub use angle::*;
|
pub use angle::*;
|
||||||
|
|
||||||
|
pub mod transform;
|
||||||
|
pub use transform::*;
|
|
@ -7,5 +7,4 @@ pub mod render_job;
|
||||||
pub mod mesh;
|
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;
|
|
|
@ -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,
|
||||||
|
|
|
@ -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]
|
||||||
|
|
Loading…
Reference in New Issue