feat: added the beginnings of a ecs based camera system. render_scene_2d crashes miserably right now but theoretically everything *should* be in place for a full adoption

This commit is contained in:
lisk77 2025-02-26 23:53:52 +01:00
parent a9a8d076ca
commit 4ce24b58dd
5 changed files with 128 additions and 33 deletions

View file

@ -200,7 +200,10 @@ impl World {
/// Returns a list of entities that have the given components.
pub fn get_entities_with(&self, components: ComponentSet) -> Vec<u32> {
assert!(self.archetypes.contains_archetype(&components), "The given components {:?} are not registered in the world!", components);
self.archetypes.get_archetype(&components).unwrap().clone()
//assert!(self.archetypes.contains_archetype(&components), "The given components {:?} are not registered in the world!", components);
if self.archetypes.contains_archetype(&components) {
return self.archetypes.get_archetype(&components).unwrap().clone();
}
Vec::new()
}
}