amethyst / specs

Specs - Parallel ECS

Home Page:https://amethyst.github.io/specs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get an entt like view of entities within a system?

BlidDev opened this issue · comments

Hi, I have a system called BulletSystem that takes Transform and BulletData components. In this system I need to check if the bullet entity collides with any entity that has the Transform and EnemyData components. Is there anything like view in entt that just gives you a list of the entities with the required components and the ability to retrieve their components? Because I didn't see anyware a way to do that within a system.

Thanks!

Simply join over the components you care about and iterate through them: https://specs.amethyst.rs/docs/tutorials/08_join.html#joining-components.

I apparently didn't understand the idea of SystemData fully yet. Thanks for your time nevertheless!