MiguelCastillo / scenic

Scene graph
MIT License
4 stars 0 forks source link

Added setDuration to animation Playback to cleanup the API #33

Closed MiguelCastillo closed 2 years ago

MiguelCastillo commented 2 years ago

Animation playback can specify a duration for the animation. This used to be provided in updateOffset and elapsed function in Playback which made things confusing beacuse calculated state relied on duration so calling updateOffset with a duration that is different than what is provided to elapsed would generate bad values. The API needing the duration is a bit noisy. So I have added a setDuration function to save that as part of the playback functionality so make things more consistent and less error prone.