SiebenCorgie / jakar-engine

Formerly "Ori-Engine" is an hobby project of mine. Target is an Rust/Vulkan engine for games and visualization software.
MIT License
19 stars 0 forks source link

Create a command system for node tree changes #22

Closed SiebenCorgie closed 6 years ago

SiebenCorgie commented 6 years ago

Currently, if you change something in the tree (like translating a node) it is done for every child at once. It would be nice to record a Vector of things to do into a tasks field. When calling update on a tree every task will be executed. This way the system would have to "walk down" the tree only once per update, instead of several time (once per action).

API mock up:

The only thing which could be optimized after that is some kind of "Scene Registry" which keeps a pointer to every node, sorted by their names. This way the get_node() function could become faster. But we would have to store this big registry. We'll see if its needed when building scenes at a bigger scale.

SiebenCorgie commented 6 years ago

The system is already written in another crate here: https://github.com/SiebenCorgie/jakar-tree It is currently being integrated in the tree and render rewrite.