Commit 2969a2c 1 parent 2b785cc commit 2969a2c Copy full SHA for 2969a2c
File tree 1 file changed +5
-3
lines changed
sceneview/src/main/java/io/github/sceneview/node
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -418,8 +418,10 @@ open class ModelNode(
418
418
}
419
419
420
420
private fun applyAnimations (frameTimeNanos : Long ) {
421
- playingAnimations.forEach { (index, animation) ->
422
- if (animation.speed == 0f ) return @forEach
421
+ val iterator = playingAnimations.iterator()
422
+ while (iterator.hasNext()) {
423
+ val (index, animation) = iterator.next()
424
+ if (animation.speed == 0f ) continue
423
425
424
426
animator.let { animator ->
425
427
val elapsedTimeSeconds = frameTimeNanos.intervalSeconds(animation.startTime)
@@ -434,7 +436,7 @@ open class ModelNode(
434
436
animator.applyAnimation(index, animationTime)
435
437
436
438
if (! animation.loop && adjustedTimeSeconds >= animationDuration) {
437
- playingAnimations .remove(index )
439
+ iterator .remove()
438
440
}
439
441
}
440
442
}
You can’t perform that action at this time.
0 commit comments