MiguelCastillo / scenic

Scene graph
MIT License
4 stars 0 forks source link

Fixed issue with animator key controller evaluating reverse animation #26

Closed MiguelCastillo closed 2 years ago

MiguelCastillo commented 2 years ago

When we create animator key controller without time intervals, calculating frame indexes for reverse animation (negative speed values) would generate wrong value for the very last frame.

To fix this, Im just going to initialize a times internal when one isn't provided with default spread of 1 second. Meaning each frame will be 1 second apart. This allowed me to get rid of the buggy logic branch I had for calculating frame indexes when time intervals werent available.

The caveat here is that we are now always searching for time intervals. In testing performance I did not see a difference in performance, however.