Open WarlockD opened 8 years ago
I think your approach would need 5 components { position, rotation, scale, matrix, dirty }. And then,
About messages, in the same spirit of ECS messages, are not implemented at the moment. I have yet to figure out if they're handy or just cumbersome in the end (ie, message-hell).
You can still create blank dynamic entities with a message-component and feed them to a hypothetical message-system btw.
btw, found this. relevant and simpler approach!
Humm, this is a good point. would it be better that, instead of a dirty flag, to just add a "dirty" component? This way the join operation only joins all the entity's that are dirty or does that break some programming convention?
Maybe instead of messages call backs? Its wracking my brain now, I rewrote this paragraph six times already. You could just copy the component system to be an array of std::function<set
I feel like you can even remove using the set
From my point of view/experience, messages can be very nasty to debug, specially when you have hundred or thousands per frame.
I rather like to examine and inspect the structs and datas in memory as they're when debugged.
You have two approaches from this point:
Hope it helps
Lets say I have three components, position, scale, rotation that updates a matrix component to trasforms a sprite. Is there a way I can detect that position/scale/rotation component has changed in the system?
The idea being that I only have to update the transform component if its changed. then if the transform component has changed, update the verticies then.
The only way I can figure out is to wrap my vector class in a struct that flips a flag when the value is changed and then reset when it goes though the system.
Any ideas?
PS - Humm. You know, when I think of it, I think I am looking for a message system. Is there any examples of that?