mbrea-c / bevy_animation_graph

Animation graphs in Bevy!
Apache License 2.0
97 stars 5 forks source link

Simplify graph architecture #11

Closed mbrea-c closed 9 months ago

mbrea-c commented 9 months ago

Objective

The generality of the current graph architecture causes complications during processing, especially when it comes to cache output. Most other animation graph implementations (as far as I'm aware of) restrict pose outputs to one per node and only allow pose outputs to be connected to one other pin. This ensures that each pose output will be queried once per frame, simplifying caching and computation.

This should also enable performance improvements, as it will be easier to replace string IDs with integers and hashmap lookups with integer indexing.

Solution

Refactored the code to enforce the following graph invariant:

Breaking changes

As part of the refactoring, the animation graph format was changed slightly. Refer to the updated examples for instructions on how to use the updated format.