-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trade: provide better AnimationTrackData constructors.
Taking Animation::TrackViewStorage wasn't really a good idea, as it wasn't solving anything -- in order to create it, there needs to be a TrackView of a concrete type first anyway, and even then it required a lot of additional verbose typing. The new constructors take basically what TrackView takes, plus there's additionally a constructor that takes a typeless value view together with explicitly specified value and result types, allowing a truly type-erased usage. On the other hand, the templated variants directly deduce the types without any additional typing, making the construction similarly straightforward to e.g. SceneFieldData. In case of the type-erased constructors, if the interpolator function isn't supplied explicitly, an implicit one is picked based on the value type, result type and interpolation. Not all combinations make sense of course, so this is a new assertion point, however compared to the previous way where the interpolator was picked from a *typed* TrackView, this doesn't add any new restriction -- what asserted there, asserts now as well, and additionally you can't have e.g. a Quaternion track with a boolean result. I may also be eventually adding assertions to check that the target name matches the result type -- so e.g. a rotation isn't specified as an integer and such. Compared to newer APIs like MeshData, MaterialData or SceneData the AnimationData API has a significant lack of sanity asserts like this.
- Loading branch information
Showing
5 changed files
with
658 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.