Преглед изворни кода

Merge pull request #7845 from reimund/master

Fixed delay calculation in Animatable.goToFrame when speedRatio != 1.
David Catuhe пре 5 година
родитељ
комит
261c3c4fb4
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 0
      dist/preview release/what's new.md
  2. 1 2
      src/Animations/animatable.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -79,6 +79,7 @@
 - Fix bug in `Plane.transform` when matrix passed in is not a pure rotation ([Popov72](https://github.com/Popov72)
 - Fix bug in PBR when anisotropy is enabled and no bump texture is provided ([Popov72](https://github.com/Popov72)
 - Fix horizon occlusion in PBR materials ([Popov72](https://github.com/Popov72)
+- Fixed delay calculation in Animatable.goToFrame when speedRatio != 1 ([Reimund Järnfors](https://github.com/reimund)
 - Fix bug in PBR when translucency is enabled and an irradiance texture is provided ([Popov72](https://github.com/Popov72)
 
 ## Breaking changes

+ 1 - 2
src/Animations/animatable.ts

@@ -269,8 +269,7 @@ export class Animatable {
         if (runtimeAnimations[0]) {
             var fps = runtimeAnimations[0].animation.framePerSecond;
             var currentFrame = runtimeAnimations[0].currentFrame;
-            var adjustTime = frame - currentFrame;
-            var delay = this.speedRatio !== 0 ? adjustTime * 1000 / (fps / this.speedRatio) : 0;
+            var delay = this.speedRatio === 0 ? 0 : ((frame - currentFrame) / fps * 1000) / this.speedRatio;
             if (this._localDelayOffset === null) {
                 this._localDelayOffset = 0;
             }