The scene graph consist of nodes
Each node holds an Vec of child nodes, transform, max_depth (longest distance to a leaf node) and an unique ID. The ID should describe the location of the node in the "tree". An example of such Id could be 0-0-1 or vec[0, 0, 1] (or array for that matter with a max depth)
Updating a node goes like:
start at root node and locate target node using id
apply change add to an delta batch for updating buffer
iterate children and update transform according to parent node
from here we can multithread using a thread pool depending on the child's children max depth
Repeate step 2 until all children are updated and prepared to be sent to gpu
Send delta batch to gpu
This could be designed around to create a simple API i.e
let tree_1_id = scene_graph.create_instance(&tree_mesh): scene_graph.translate(tree_1_id, 10, 0, 0) // TODO: describe creating nodes and adding them to the tree
TODO: Redefine return ID as a struct consisting of ids so that API user can create a "virtual tree" to interface with
The scene graph consist of nodes Each node holds an Vec of child nodes, transform, max_depth (longest distance to a leaf node) and an unique ID. The ID should describe the location of the node in the "tree". An example of such Id could be 0-0-1 or vec[0, 0, 1] (or array for that matter with a max depth)
Updating a node goes like:
This could be designed around to create a simple API i.e
let tree_1_id = scene_graph.create_instance(&tree_mesh): scene_graph.translate(tree_1_id, 10, 0, 0) // TODO: describe creating nodes and adding them to the tree
TODO: Redefine return ID as a struct consisting of ids so that API user can create a "virtual tree" to interface with