jpaver / opengametools

A set of open c++ game development tools that are lightweight, easy-to-integrate and free to use. Currently hosting a magicavoxel .vox full scene loader.
MIT License
373 stars 35 forks source link

ogt_vox: group instances are not preserved when writing scenes #33

Open jpaver opened 2 years ago

jpaver commented 2 years ago

I recently learned Magicavoxel supports copying groups by reference, which means the underlying scene hierarchy is a directed-acyclic-graph that has leaf nodes or group nodes with multiple parents ie. diamond patterns in the graph.

ogt_vox exposes the scene hierarchy as a tree with instances as the leaf nodes and with groups as the branches, so has no diamond patterns.

ogt_vox_read_scene does in fact work when loading scenes that contain group references, it just does not preserve the group information when the scene is re-saved out via ogt_vox_write_scene.

We should look into options for supporting this, and whether it can be done without changes to client code that uses ogt_vox.