Closed dakom closed 2 years ago
Discord would probably be a better place to discuss this in more depth. Closing for now since it's not really an issue, more just a discussion point.
(yes- a scene graph could definitely build on Dominator, or more accurately on futures-signals)
Yeah, I think a scene graph for canvas/WebGL/WebGPU should be a separate crate, which uses futures-signals. It wouldn't really be tied to dominator, it would have its own custom tree system.
So this might be a bit early since I haven't actually tried working with Dominator yet, and I'm also not sure exactly how I'd want to build this out for practical usage, and it's not dom related... but...
On one foot, I'm wondering if I could have a tree of transforms where nodes listen to signals and upon change it causes specific properties of those nodes to cascade down.
So for example, changing a
Mutable<Position>
would cause that element'sLocalTransform
to change - and any LocalTransform change would cause that element and their children to update theirWorldTransform
's.Along with the cascading changes, another gotcha is that some of them should be done in batches and a separate step. For example, perhaps the change from Position to LocalTransform is immediate, but updating all the WorldTransforms for dirty elements is once per tick.
It seems like Dominator is very related to this problem too since it's a tree and maybe does some batching too...?