add fade in/out to dynamic bone animations

This commit is contained in:
Nick Fisher
2024-06-04 13:14:53 +08:00
parent 765d0e0839
commit f31bbccdc9
8 changed files with 115 additions and 33 deletions

View File

@@ -1025,7 +1025,8 @@ namespace flutter_filament
int boneIndex,
const float *const frameData,
int numFrames,
float frameLengthInMs)
float frameLengthInMs,
float fadeOutInSecs, float fadeInInSecs)
{
std::lock_guard lock(_mutex);
@@ -1079,6 +1080,8 @@ namespace flutter_filament
animation.durationInSecs = (frameLengthInMs * numFrames) / 1000.0f;
animation.lengthInFrames = numFrames;
animation.frameLengthInMs = frameLengthInMs;
animation.fadeOutInSecs = fadeOutInSecs;
animation.fadeInInSecs = fadeInInSecs;
animation.skinIndex = skinIndex;
if(!_animationComponentManager->hasComponent(instance->getRoot())) {
Log("ERROR: specified entity is not animatable (has no animation component attached).");