Hey yall! I'm still working on understanding how the whole ECS works in practice.
Currently I am trying to write a SCeneHook closure that will add a collider to all my objects that contain a Cube, using the contained cube's Aabb's half_extents.
However, I am struggling to figure out how to get access to the Cube inside the Entity I am looking at since I don't know how to convert an Entity to an EntityRef. Or maybe it's the wrong approach altogether?
Any help is appreciated!
here's the code I currently have:
hook: SceneHook::new(|entity, cmds| {
entity
.get::<Children>()
.and_then(|c| c.iter().filter(|e| EntityRef::from(e) ??? ));
}