-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a component trigger changed
filter for other components
#84
Comments
I'm not a legion expert but I have a theory: the archetype changed when you added Bar, which resulted in a move of the entity's components, which triggered a "changed" event for Foo? |
Cart is right. When you add a component to an entity, it internally moves the entity into a new chunk, which will cause all components to be seen as changed. Composition changes are essentially removing the entity and then inserting a new one with the same |
Its good that we understand why its happening, but is the behavior of this event desirable? Is there a way to make the event behave the way most people would expect it to? It makes the event less useful for things like "I only want to update the transform hierarchy when the position component changes". |
In that case, the value of the component hasnt changed. Only the internal legion representation of the value. From the perspective of the public interface presented nothing has changed. |
Yes, I've come to the same conclusion that archetype change is in cause. Specifically, Some possibilities i see:
let me know if you have any other ideas I'm not really familiar with legion nor the archetype storage strategy, if you have some documents or articles around these subject, it might worth putting a link into the readme, took me a lot of time getting my head around the basic principle. |
Any news / feedback on this ? |
It seems to be fixed now on master, probably in c99326e |
Here is a simple example:
output
It's not clear to me if it is the intended behavior, but typing
.filter(changed::<Foo>())
strongly suggest it will pull only entities with modifiedFoo
components.Tested against 0.2.1 and master.
The text was updated successfully, but these errors were encountered: