mirror of
https://github.com/lisk77/comet.git
synced 2025-10-23 21:38:50 +00:00
fix: the code in flat_map should now be correct and changed formatting in renderer2d
This commit is contained in:
parent
ac63691fe3
commit
30cda18ce1
6 changed files with 483 additions and 11 deletions
|
|
@ -782,17 +782,17 @@ impl<'a> Renderer2D<'a> {
|
|||
self.camera_uniform = camera_uniform;
|
||||
self.camera_bind_group = camera_bind_group;
|
||||
|
||||
let mut visible_entities: Vec<u32> = vec![];
|
||||
for entity in world.entities() {
|
||||
if camera_component.in_view_frustum(*camera_position, *world.get_component::<Transform2D>(*entity.clone().unwrap().id() as usize).unwrap().position()) {
|
||||
if let Some(render) = world.get_component::<Render2D>(*entity.clone().unwrap().id() as usize) {
|
||||
if render.is_visible() {
|
||||
visible_entities.push(*entity.clone().unwrap().id());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
println!("{:?}", visible_entities);
|
||||
let mut visible_entities: Vec<u32> = vec![];
|
||||
for entity in world.entities() {
|
||||
if camera_component.in_view_frustum(*camera_position, *world.get_component::<Transform2D>(*entity.clone().unwrap().id() as usize).unwrap().position()) {
|
||||
if let Some(render) = world.get_component::<Render2D>(*entity.clone().unwrap().id() as usize) {
|
||||
if render.is_visible() {
|
||||
visible_entities.push(*entity.clone().unwrap().id());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
println!("{:?}", visible_entities);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue