From 06c811bb4dc263b3b008c89eacff55b9b1ace2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 3 Aug 2018 11:03:55 +0200 Subject: [PATCH] Animation: put a reminder for myself. At the moment, with the major use case, which is playing back glTF animations, one can't use atStrict() because there Extrapolation is specified to be always Constant. The atStrict() function behaves as Extrapolate and one would need to patch the imported tracks to add explicit keyframes at the beginning/end of the duration that emulate the Constant behavior. --- src/Magnum/Animation/Player.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Magnum/Animation/Player.h b/src/Magnum/Animation/Player.h index b47ec98bf..7e40ac817 100644 --- a/src/Magnum/Animation/Player.h +++ b/src/Magnum/Animation/Player.h @@ -660,6 +660,7 @@ template template Player(callback); return addInternal(track, [](const TrackViewStorage& track, K key, std::size_t& hint, void*, void(*callback)(), void* userData) { + /** @todo try to use atStrict() if possible */ reinterpret_cast(callback)(key, static_cast&>(track).at(key, hint), userData); }, nullptr, reinterpret_cast(callbackPtr), userData); } @@ -668,6 +669,7 @@ template template P auto callbackPtr = static_cast(callback); return addInternal(track, [](const TrackViewStorage& track, K key, std::size_t& hint, void*, void(*callback)(), void* userData) { + /** @todo try to use atStrict() if possible */ reinterpret_cast(callback)(key, static_cast&>(track).at(key, hint), *static_cast(userData)); }, nullptr, reinterpret_cast(callbackPtr), &userData); } @@ -676,6 +678,7 @@ template template Player(callback); return addInternal(track, [](const TrackViewStorage& track, K key, std::size_t& hint, void* destination, void(*callback)(), void* userData) { + /** @todo try to use atStrict() if possible */ R result = static_cast&>(track).at(key, hint); if(result == *static_cast(destination)) return; reinterpret_cast(callback)(key, result, userData); @@ -687,6 +690,7 @@ template template P auto callbackPtr = static_cast(callback); return addInternal(track, [](const TrackViewStorage& track, K key, std::size_t& hint, void* destination, void(*callback)(), void* userData) { + /** @todo try to use atStrict() if possible */ R result = static_cast&>(track).at(key, hint); if(result == *static_cast(destination)) return; reinterpret_cast(callback)(key, result, *static_cast(userData));