Skip to content

Commit

Permalink
solve issue #1813 (glTF loader loses keyframes)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed May 8, 2022
1 parent 1adbd56 commit afb68ef
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2022 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -90,7 +90,14 @@ public void update() {
KeyFrame kf = keyFrames.get(j);
if (Float.floatToIntBits(kf.time) != Float.floatToIntBits(time)) {
if (time > kf.time) {
continue;
if (j < keyFrames.size() - 1) {
// Keep searching for the insertion point.
continue;
}
kf = new KeyFrame();
kf.time = time;
// Add kf after the last keyframe in the list.
keyFrames.add(kf);
} else {
kf = new KeyFrame();
kf.time = time;
Expand Down

0 comments on commit afb68ef

Please sign in to comment.