rendering, physics, player and camera WIP

This commit is contained in:
Jonas H
2026-01-01 19:54:00 +01:00
commit 5d2eca0393
51 changed files with 8734 additions and 0 deletions

23
src/systems/render.rs Normal file
View File

@@ -0,0 +1,23 @@
use crate::render::DrawCall;
use crate::world::World;
pub fn render_system(world: &World) -> Vec<DrawCall>
{
let all_entities = world.entities.all_entities();
all_entities
.iter()
.filter_map(|&entity| {
let transform = world.transforms.get(entity)?;
let mesh_component = world.meshes.get(entity)?;
Some(DrawCall {
vertex_buffer: mesh_component.mesh.vertex_buffer.clone(),
index_buffer: mesh_component.mesh.index_buffer.clone(),
num_indices: mesh_component.mesh.num_indices,
model: transform.to_matrix(),
pipeline: mesh_component.pipeline,
})
})
.collect()
}